Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fuzzBackEnd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钱炳权
fuzzBackEnd
Commits
13284f0d
Commit
13284f0d
authored
Apr 02, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
24/4/2 reconsitution
parent
4f11b8a8
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
134 additions
and
85 deletions
+134
-85
kittyProperties.java
...n/java/com/example/fuzzControll/conf/kittyProperties.java
+9
-0
mutationConstent.java
.../com/example/fuzzControll/constents/mutationConstent.java
+6
-0
kittyServerMessageController.java
...fuzzControll/controller/kittyServerMessageController.java
+3
-0
mutationController.java
...m/example/fuzzControll/controller/mutationController.java
+0
-24
protocolTemplatController.java
...le/fuzzControll/controller/protocolTemplatController.java
+0
-29
seedFileController.java
...m/example/fuzzControll/controller/seedFileController.java
+3
-0
testClassController.java
.../example/fuzzControll/controller/testClassController.java
+42
-4
testControler.java
...va/com/example/fuzzControll/controller/testControler.java
+3
-0
vulnerabilityTypeController.java
.../fuzzControll/controller/vulnerabilityTypeController.java
+0
-26
mutationServiceImpl.java
...xample/fuzzControll/service/impl/mutationServiceImpl.java
+56
-0
mutationService.java
...ava/com/example/fuzzControll/service/mutationService.java
+10
-0
application-dev.yml
fuzzbackend/src/main/resources/application-dev.yml
+2
-2
No files found.
fuzzbackend/src/main/java/com/example/fuzzControll/conf/kittyProperties.java
View file @
13284f0d
...
@@ -14,6 +14,15 @@ public class kittyProperties {
...
@@ -14,6 +14,15 @@ public class kittyProperties {
String
statsHttp
;
String
statsHttp
;
String
stagesHttp
;
String
stagesHttp
;
String
reportHttp
;
String
reportHttp
;
String
mutationPath
;
public
String
getMutationPath
()
{
return
mutationPath
;
}
public
void
setMutationPath
(
String
mutationPath
)
{
this
.
mutationPath
=
mutationPath
;
}
public
String
getTemplateInfoHttp
()
{
public
String
getTemplateInfoHttp
()
{
return
templateInfoHttp
;
return
templateInfoHttp
;
...
...
fuzzbackend/src/main/java/com/example/fuzzControll/constents/mutationConstent.java
0 → 100644
View file @
13284f0d
package
com
.
example
.
fuzzControll
.
constents
;
public
class
mutationConstent
{
public
static
final
String
GET_FILE_NAME
=
"ls -h "
;
}
fuzzbackend/src/main/java/com/example/fuzzControll/controller/kittyServerMessageController.java
View file @
13284f0d
...
@@ -7,6 +7,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -7,6 +7,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* kitty服务器信息
*/
@RestController
@RestController
@RequestMapping
(
"/kittyServer"
)
@RequestMapping
(
"/kittyServer"
)
public
class
kittyServerMessageController
{
public
class
kittyServerMessageController
{
...
...
fuzzbackend/src/main/java/com/example/fuzzControll/controller/mutationController.java
deleted
100644 → 0
View file @
4f11b8a8
package
com
.
example
.
fuzzControll
.
controller
;
import
com.example.fuzzControll.pojo.vo.AjaxResult
;
import
com.example.fuzzControll.service.getServerMessageService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/mutation"
)
public
class
mutationController
{
@Autowired
getServerMessageService
getServerMessageService
;
@RequestMapping
(
value
=
"/mutation"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
getStats
()
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getStats
());
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"mutationTest失败!"
);
}
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/controller/protocolTemplatController.java
deleted
100644 → 0
View file @
4f11b8a8
package
com
.
example
.
fuzzControll
.
controller
;
import
com.example.fuzzControll.pojo.vo.AjaxResult
;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
com.example.fuzzControll.service.protocolTemplateService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/protocolTemplate"
)
public
class
protocolTemplatController
{
@Autowired
protocolTemplateService
protocolTemplateService
;
/**
* seeFileUpload
*/
@RequestMapping
(
value
=
"/generation"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
testEntity
testEntity
)
{
try
{
return
AjaxResult
.
success
(
protocolTemplateService
.
generation
(
testEntity
));
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"模板文件生成失败!"
);
}
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/controller/seedFileController.java
View file @
13284f0d
...
@@ -11,6 +11,9 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -11,6 +11,9 @@ import org.springframework.web.multipart.MultipartFile;
import
java.util.List
;
import
java.util.List
;
/**
* aflnet种子文件
*/
@RestController
@RestController
@RequestMapping
(
"/seedFile"
)
@RequestMapping
(
"/seedFile"
)
public
class
seedFileController
{
public
class
seedFileController
{
...
...
fuzzbackend/src/main/java/com/example/fuzzControll/controller/testClassController.java
View file @
13284f0d
...
@@ -4,35 +4,73 @@ import com.example.fuzzControll.pojo.vo.AjaxResult;
...
@@ -4,35 +4,73 @@ import com.example.fuzzControll.pojo.vo.AjaxResult;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
com.example.fuzzControll.service.generateMethodService
;
import
com.example.fuzzControll.service.generateMethodService
;
import
com.example.fuzzControll.service.getServerMessageService
;
import
com.example.fuzzControll.service.getServerMessageService
;
import
com.example.fuzzControll.service.protocolTemplateService
;
import
com.example.fuzzControll.service.vulnerabilityTypeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 不同类型的测试方法
*/
@RestController
@RestController
@RequestMapping
(
"/testClass"
)
@RequestMapping
(
"/testClass"
)
public
class
testClassController
{
public
class
testClassController
{
@Autowired
@Autowired
generateMethodService
s
ervice
;
generateMethodService
generateMethodS
ervice
;
@Autowired
@Autowired
getServerMessageService
getServerMessageService
;
getServerMessageService
getServerMessageService
;
@Autowired
protocolTemplateService
protocolTemplateService
;
@Autowired
vulnerabilityTypeService
vulnerabilityTypeService
;
/**
* 模板
*/
@RequestMapping
(
value
=
"/protocolTemplate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
protocolTemplate
(
@RequestBody
testEntity
testEntity
)
{
try
{
return
AjaxResult
.
success
(
protocolTemplateService
.
generation
(
testEntity
));
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"模板文件生成失败!"
);
}
}
/**
*生成方法
*/
@RequestMapping
(
value
=
"/generate"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/generate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
testEntity
testEntity
)
{
public
AjaxResult
generate
(
@RequestBody
testEntity
testEntity
)
{
try
{
try
{
return
AjaxResult
.
success
(
s
ervice
.
generation
(
testEntity
));
return
AjaxResult
.
success
(
generateMethodS
ervice
.
generation
(
testEntity
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"变异方法使用失败!"
);
return
AjaxResult
.
error
(
"变异方法使用失败!"
);
}
}
}
}
/**
*变异方法
*/
@RequestMapping
(
value
=
"/mutation"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/mutation"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
getStats
()
{
public
AjaxResult
mutation
()
{
try
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getStats
());
return
AjaxResult
.
success
(
getServerMessageService
.
getStats
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"mutationTest失败!"
);
return
AjaxResult
.
error
(
"mutationTest失败!"
);
}
}
}
}
/**
*漏洞类型
*/
@RequestMapping
(
value
=
"/vulnerabilityType"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
testEntity
testEntity
)
{
try
{
return
AjaxResult
.
success
(
vulnerabilityTypeService
.
generation
(
testEntity
));
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"漏洞类型测试失败!"
);
}
}
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/controller/testControler.java
View file @
13284f0d
...
@@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* aflnet测试控制
*/
@RestController
@RestController
@RequestMapping
(
"/test"
)
@RequestMapping
(
"/test"
)
public
class
testControler
{
public
class
testControler
{
...
...
fuzzbackend/src/main/java/com/example/fuzzControll/controller/vulnerabilityTypeController.java
deleted
100644 → 0
View file @
4f11b8a8
package
com
.
example
.
fuzzControll
.
controller
;
import
com.example.fuzzControll.pojo.vo.AjaxResult
;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
com.example.fuzzControll.service.vulnerabilityTypeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/vulnerabilityType"
)
public
class
vulnerabilityTypeController
{
@Autowired
vulnerabilityTypeService
service
;
@RequestMapping
(
value
=
"/generate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
testEntity
testEntity
)
{
try
{
return
AjaxResult
.
success
(
service
.
generation
(
testEntity
));
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"漏洞类型测试失败!"
);
}
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/impl/mutationServiceImpl.java
0 → 100644
View file @
13284f0d
package
com
.
example
.
fuzzControll
.
service
.
impl
;
import
com.example.fuzzControll.conf.kittyProperties
;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
com.example.fuzzControll.service.mutationService
;
import
com.example.fuzzControll.tools.cmdTools
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"mutationService"
)
@Slf4j
public
class
mutationServiceImpl
implements
mutationService
{
cmdTools
cmdTools
=
new
cmdTools
();
@Autowired
kittyProperties
kitty
;
@Override
public
Map
<
String
,
List
<
String
>>
generation
(
testEntity
testEntity
)
{
String
cmd
=
parseParameters
(
testEntity
);
return
cmdTools
.
runProgramCmdAndResult
(
cmd
);
}
public
String
parseParameters
(
testEntity
testEntity
)
{
switch
(
testEntity
.
getTestClassName
().
toLowerCase
())
{
case
"foreach"
:
return
foreachCmd
(
testEntity
);
default
:
log
.
error
(
"未知变异方法![{}]"
,
testEntity
.
getTestClassName
());
return
null
;
}
}
private
String
foreachCmd
(
testEntity
testEntity
)
{
String
target_host
=
null
;
String
target_port
=
null
;
String
s1
=
null
;
String
s2
=
null
;
String
s3
=
null
;
try
{
target_host
=
testEntity
.
getParamJson
()[
0
];
target_port
=
testEntity
.
getParamJson
()[
1
];
s1
=
testEntity
.
getParamJson
()[
2
];
s2
=
testEntity
.
getParamJson
()[
3
];
s3
=
testEntity
.
getParamJson
()[
4
];
}
catch
(
Exception
e
)
{
log
.
error
(
"http_dos_qemu参数解析失败!"
);
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getMutationPath
()
+
"generate_method_test.py -f "
+
s1
+
" "
+
s2
+
" "
+
s3
+
" --host="
+
target_host
+
" --port="
+
target_port
;
}
//todo 还有很多生成方法
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/mutationService.java
0 → 100644
View file @
13284f0d
package
com
.
example
.
fuzzControll
.
service
;
import
com.example.fuzzControll.pojo.vo.testEntity
;
import
java.util.List
;
import
java.util.Map
;
public
interface
mutationService
{
Map
<
String
,
List
<
String
>>
generation
(
testEntity
testEntity
);
}
fuzzbackend/src/main/resources/application-dev.yml
View file @
13284f0d
...
@@ -21,7 +21,8 @@ kitty:
...
@@ -21,7 +21,8 @@ kitty:
venvPath
:
"
/home/qbq/fuzz50/kitty/venv/bin/python"
venvPath
:
"
/home/qbq/fuzz50/kitty/venv/bin/python"
methodPath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下变异方法路径
methodPath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下变异方法路径
vulnerabilityTypePath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下漏洞类型python路径
vulnerabilityTypePath
:
"
/home/qbq/fuzz50/kitty/2020test/"
#kitty下漏洞类型python路径
mutationPath
:
"
/home/qbq/fuzz50/kitty/2020test/"
templateInfoHttp
:
"
http://127.0.0.1:26001/api/template_info.json"
#模板信息请求链接
templateInfoHttp
:
"
http://127.0.0.1:26001/api/template_info.json"
#模板信息请求链接
statsHttp
:
"
http://127.0.0.1:26001/api/stats.json"
#运行时数据
statsHttp
:
"
http://127.0.0.1:26001/api/stats.json"
#运行时数据
stagesHttp
:
"
http://127.0.0.1:26001/api/stages.json"
#
stagesHttp
:
"
http://127.0.0.1:26001/api/stages.json"
#
reportHttp
:
"
http://127.0.0.1:26001/api/report"
#
reportHttp
:
"
http://127.0.0.1:26001/api/report"
#
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment