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
c96a10bd
Commit
c96a10bd
authored
a year ago
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exception is chaged
parent
1c41f8b1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
26 deletions
+40
-26
KittyServerMessageController.java
...fuzzControll/controller/KittyServerMessageController.java
+5
-4
SeedFileController.java
...m/example/fuzzControll/controller/SeedFileController.java
+3
-3
TestClassController.java
.../example/fuzzControll/controller/TestClassController.java
+8
-1
TestControler.java
...va/com/example/fuzzControll/controller/TestControler.java
+3
-1
WebSocket.java
...n/java/com/example/fuzzControll/controller/WebSocket.java
+0
-1
GetServerMessageImpl.java
...ample/fuzzControll/service/impl/GetServerMessageImpl.java
+2
-6
ProtocolTemplateImpl.java
...ample/fuzzControll/service/impl/ProtocolTemplateImpl.java
+16
-10
CmdTools.java
...rc/main/java/com/example/fuzzControll/tools/CmdTools.java
+3
-0
No files found.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/KittyServerMessageController.java
View file @
c96a10bd
...
@@ -27,19 +27,20 @@ public class KittyServerMessageController {
...
@@ -27,19 +27,20 @@ public class KittyServerMessageController {
try
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getStats
());
return
AjaxResult
.
success
(
getServerMessageService
.
getStats
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"stats信息获取失败!"
);
return
AjaxResult
.
error
(
"stats信息获取失败!"
);
}
}
}
}
/**
/**
* 获取服务器templateInfo信息
* 获取服务器templateInfo信息
*/
*/
//todo first
@RequestMapping
(
value
=
"/templateInfo"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/templateInfo"
,
method
=
RequestMethod
.
GET
)
public
AjaxResult
getTemplateInfo
(
)
{
public
AjaxResult
getTemplateInfo
(
)
{
try
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getTemplateInfo
());
return
AjaxResult
.
success
(
getServerMessageService
.
getTemplateInfo
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"templateInfo信息获取失败!"
);
return
AjaxResult
.
error
(
"templateInfo信息获取失败!"
);
}
}
}
}
...
@@ -51,7 +52,7 @@ public class KittyServerMessageController {
...
@@ -51,7 +52,7 @@ public class KittyServerMessageController {
try
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getStages
());
return
AjaxResult
.
success
(
getServerMessageService
.
getStages
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"stages信息获取失败!"
);
return
AjaxResult
.
error
(
"stages信息获取失败!"
);
}
}
}
}
...
@@ -63,7 +64,7 @@ public class KittyServerMessageController {
...
@@ -63,7 +64,7 @@ public class KittyServerMessageController {
try
{
try
{
return
AjaxResult
.
success
(
getServerMessageService
.
getReport
());
return
AjaxResult
.
success
(
getServerMessageService
.
getReport
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"report信息获取失败!"
);
return
AjaxResult
.
error
(
"report信息获取失败!"
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/SeedFileController.java
View file @
c96a10bd
...
@@ -33,7 +33,7 @@ public class SeedFileController {
...
@@ -33,7 +33,7 @@ public class SeedFileController {
try
{
try
{
files
=
service
.
getSeedFiles
();
files
=
service
.
getSeedFiles
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"种子文件获取失败!"
);
return
AjaxResult
.
error
(
"种子文件获取失败!"
);
}
}
return
AjaxResult
.
success
(
files
);
return
AjaxResult
.
success
(
files
);
...
@@ -47,7 +47,7 @@ public class SeedFileController {
...
@@ -47,7 +47,7 @@ public class SeedFileController {
try
{
try
{
service
.
delFile
(
fileName
);
service
.
delFile
(
fileName
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"种子文件删除失败!"
);
return
AjaxResult
.
error
(
"种子文件删除失败!"
);
}
}
return
AjaxResult
.
success
(
"种子文件删除成功!"
);
return
AjaxResult
.
success
(
"种子文件删除成功!"
);
...
@@ -60,7 +60,7 @@ public class SeedFileController {
...
@@ -60,7 +60,7 @@ public class SeedFileController {
try
{
try
{
service
.
upload
(
file
);
service
.
upload
(
file
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"种子文件upload失败!"
);
return
AjaxResult
.
error
(
"种子文件upload失败!"
);
}
}
return
AjaxResult
.
success
(
"种子文件upload成功!"
);
return
AjaxResult
.
success
(
"种子文件upload成功!"
);
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/TestClassController.java
View file @
c96a10bd
...
@@ -6,18 +6,21 @@ import com.example.fuzzControll.service.GenerateMethodService;
...
@@ -6,18 +6,21 @@ import com.example.fuzzControll.service.GenerateMethodService;
import
com.example.fuzzControll.service.MutationService
;
import
com.example.fuzzControll.service.MutationService
;
import
com.example.fuzzControll.service.ProtocolTemplateService
;
import
com.example.fuzzControll.service.ProtocolTemplateService
;
import
com.example.fuzzControll.service.VulnerabilityTypeService
;
import
com.example.fuzzControll.service.VulnerabilityTypeService
;
import
lombok.extern.slf4j.Slf4j
;
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
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* 不同类型的测试方法
* 不同类型的测试方法
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/testClass"
)
@RequestMapping
(
"/testClass"
)
public
class
TestClassController
{
public
class
TestClassController
{
...
@@ -38,7 +41,8 @@ public class TestClassController {
...
@@ -38,7 +41,8 @@ public class TestClassController {
Map
<
String
,
List
<
String
>>
result
=
protocolTemplateService
.
generation
(
testEntity
);
Map
<
String
,
List
<
String
>>
result
=
protocolTemplateService
.
generation
(
testEntity
);
return
AjaxResult
.
success
(
result
==
null
?
"模板文件生成未成功运行"
:
result
);
return
AjaxResult
.
success
(
result
==
null
?
"模板文件生成未成功运行"
:
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"模板文件生成失败!"
);
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
e
.
getMessage
());
}
}
}
}
...
@@ -51,6 +55,7 @@ public class TestClassController {
...
@@ -51,6 +55,7 @@ public class TestClassController {
Map
<
String
,
List
<
String
>>
result
=
generateMethodService
.
generation
(
testEntity
);
Map
<
String
,
List
<
String
>>
result
=
generateMethodService
.
generation
(
testEntity
);
return
AjaxResult
.
success
(
result
==
null
?
"生成方法未成功运行"
:
result
);
return
AjaxResult
.
success
(
result
==
null
?
"生成方法未成功运行"
:
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
"生成方法使用失败!"
);
return
AjaxResult
.
error
(
"生成方法使用失败!"
);
}
}
}
}
...
@@ -64,6 +69,7 @@ public class TestClassController {
...
@@ -64,6 +69,7 @@ public class TestClassController {
Map
<
String
,
List
<
String
>>
result
=
mutationService
.
generation
(
testEntity
);
Map
<
String
,
List
<
String
>>
result
=
mutationService
.
generation
(
testEntity
);
return
AjaxResult
.
success
(
result
==
null
?
"mutationTest未成功运行"
:
result
);
return
AjaxResult
.
success
(
result
==
null
?
"mutationTest未成功运行"
:
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
"mutationTest失败!"
);
return
AjaxResult
.
error
(
"mutationTest失败!"
);
}
}
}
}
...
@@ -77,6 +83,7 @@ public class TestClassController {
...
@@ -77,6 +83,7 @@ public class TestClassController {
Map
<
String
,
List
<
String
>>
result
=
vulnerabilityTypeService
.
generation
(
testEntity
);
Map
<
String
,
List
<
String
>>
result
=
vulnerabilityTypeService
.
generation
(
testEntity
);
return
AjaxResult
.
success
(
result
==
null
?
"漏洞类型未成功运行"
:
result
);
return
AjaxResult
.
success
(
result
==
null
?
"漏洞类型未成功运行"
:
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
"漏洞类型测试失败!"
);
return
AjaxResult
.
error
(
"漏洞类型测试失败!"
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/TestControler.java
View file @
c96a10bd
...
@@ -31,11 +31,12 @@ public class TestControler {
...
@@ -31,11 +31,12 @@ public class TestControler {
new
Thread
(
new
Runnable
()
{
new
Thread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
log
.
info
(
"aflnet start!"
);
service
.
testStart
(
cmdStartParams
);
service
.
testStart
(
cmdStartParams
);
}
}
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
Arrays
.
toString
(
e
.
getStackTrace
()
));
log
.
error
(
e
.
getMessage
(
));
return
AjaxResult
.
error
(
"测试启动失败!"
);
return
AjaxResult
.
error
(
"测试启动失败!"
);
}
}
return
AjaxResult
.
success
(
"测试启动成功!"
);
return
AjaxResult
.
success
(
"测试启动成功!"
);
...
@@ -49,6 +50,7 @@ public class TestControler {
...
@@ -49,6 +50,7 @@ public class TestControler {
try
{
try
{
service
.
testStop
();
service
.
testStop
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
"测试停止失败!"
);
return
AjaxResult
.
error
(
"测试停止失败!"
);
}
}
return
AjaxResult
.
success
(
"测试停止成功!"
);
return
AjaxResult
.
success
(
"测试停止成功!"
);
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/WebSocket.java
View file @
c96a10bd
...
@@ -94,7 +94,6 @@ public class WebSocket {
...
@@ -94,7 +94,6 @@ public class WebSocket {
public
void
appointSending
(
String
sender
,
String
name
,
String
message
)
{
public
void
appointSending
(
String
sender
,
String
name
,
String
message
)
{
try
{
try
{
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
WEBSOCKET_CONCURRENTHASHMAP
.
get
(
name
).
session
.
getBasicRemote
().
sendText
(
message
);
WEBSOCKET_CONCURRENTHASHMAP
.
get
(
name
).
session
.
getBasicRemote
().
sendText
(
message
);
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/service/impl/GetServerMessageImpl.java
View file @
c96a10bd
...
@@ -18,7 +18,7 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -18,7 +18,7 @@ public class GetServerMessageImpl implements GetServerMessageService {
@Autowired
@Autowired
KittyProperties
kitty
;
KittyProperties
kitty
;
public
String
getServerMsg
(
String
messageName
)
throws
ServerException
{
public
String
getServerMsg
(
String
messageName
)
{
switch
(
messageName
)
{
switch
(
messageName
)
{
case
"templateInfo"
:
{
case
"templateInfo"
:
{
HttpGet
httpGetTemplateInfo
=
new
HttpGet
(
kitty
.
getTemplateInfoHttp
());
HttpGet
httpGetTemplateInfo
=
new
HttpGet
(
kitty
.
getTemplateInfoHttp
());
...
@@ -26,7 +26,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -26,7 +26,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
CloseableHttpResponse
templateInfoResponse
=
httpClient
.
execute
(
httpGetTemplateInfo
);)
{
CloseableHttpResponse
templateInfoResponse
=
httpClient
.
execute
(
httpGetTemplateInfo
);)
{
return
EntityUtils
.
toString
(
templateInfoResponse
.
getEntity
(),
"utf-8"
);
return
EntityUtils
.
toString
(
templateInfoResponse
.
getEntity
(),
"utf-8"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"templateInfo http error!"
);
throw
new
ServerException
(
"get server templateInfo error !"
);
throw
new
ServerException
(
"get server templateInfo error !"
);
}
}
}
}
...
@@ -36,7 +35,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -36,7 +35,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
CloseableHttpResponse
statsResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
CloseableHttpResponse
statsResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
return
EntityUtils
.
toString
(
statsResponse
.
getEntity
(),
"utf-8"
);
return
EntityUtils
.
toString
(
statsResponse
.
getEntity
(),
"utf-8"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"stats http error!"
);
throw
new
ServerException
(
"get server stats error !"
);
throw
new
ServerException
(
"get server stats error !"
);
}
}
}
}
...
@@ -46,7 +44,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -46,7 +44,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
CloseableHttpResponse
reportResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
CloseableHttpResponse
reportResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
return
EntityUtils
.
toString
(
reportResponse
.
getEntity
(),
"utf-8"
);
return
EntityUtils
.
toString
(
reportResponse
.
getEntity
(),
"utf-8"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"report http error!"
);
throw
new
ServerException
(
"get server report error !"
);
throw
new
ServerException
(
"get server report error !"
);
}
}
...
@@ -57,7 +54,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -57,7 +54,6 @@ public class GetServerMessageImpl implements GetServerMessageService {
CloseableHttpResponse
stagesResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
CloseableHttpResponse
stagesResponse
=
httpClient
.
execute
(
httpGetStats
);)
{
return
EntityUtils
.
toString
(
stagesResponse
.
getEntity
(),
"utf-8"
);
return
EntityUtils
.
toString
(
stagesResponse
.
getEntity
(),
"utf-8"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"stages http error!"
);
throw
new
ServerException
(
"get server stages error !"
);
throw
new
ServerException
(
"get server stages error !"
);
}
}
}
}
...
@@ -67,7 +63,7 @@ public class GetServerMessageImpl implements GetServerMessageService {
...
@@ -67,7 +63,7 @@ public class GetServerMessageImpl implements GetServerMessageService {
}
}
@Override
@Override
public
String
getStats
()
throws
ServerException
{
public
String
getStats
()
{
return
getServerMsg
(
"stats"
);
return
getServerMsg
(
"stats"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/service/impl/ProtocolTemplateImpl.java
View file @
c96a10bd
...
@@ -26,15 +26,16 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -26,15 +26,16 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
public
Map
<
String
,
List
<
String
>>
generation
(
TestEntity
testEntity
)
throws
FuzzException
{
public
Map
<
String
,
List
<
String
>>
generation
(
TestEntity
testEntity
)
throws
FuzzException
{
String
cmd
=
parseParameters
(
testEntity
);
String
cmd
=
parseParameters
(
testEntity
);
if
(
cmd
.
isEmpty
())
{
if
(
cmd
.
isEmpty
())
{
return
null
;
throw
new
FuzzException
(
"cmd is null!"
)
;
}
}
return
cmdTools
.
runProgramCmdAndResult
(
cmd
);
return
cmdTools
.
runProgramCmdAndResult
(
cmd
);
}
}
public
String
parseParameters
(
TestEntity
testEntity
)
{
public
String
parseParameters
(
TestEntity
testEntity
)
throws
FuzzException
{
if
(
testEntity
==
null
)
{
if
(
testEntity
==
null
)
{
throw
new
FuzzException
(
"testEntity is null!"
);
throw
new
FuzzException
(
"testEntity is null!"
);
}
}
try
{
switch
(
testEntity
.
getTestClassName
().
toLowerCase
())
{
switch
(
testEntity
.
getTestClassName
().
toLowerCase
())
{
case
"arp"
:
case
"arp"
:
return
arpCmd
(
testEntity
);
return
arpCmd
(
testEntity
);
...
@@ -127,10 +128,14 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -127,10 +128,14 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
return
null
;
return
null
;
//TODO testcase_dos/testcase_rpc/ftp_vuln_reproduce
//TODO testcase_dos/testcase_rpc/ftp_vuln_reproduce
}
}
}
catch
(
Exception
e
)
{
throw
new
FuzzException
(
"Count of params is not match!"
);
}
}
}
private
String
tcpCmd
(
TestEntity
testEntity
)
{
private
String
tcpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"tcp"
)){
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"tcp"
))
{
return
""
;
return
""
;
}
}
String
dst_ip
=
null
;
String
dst_ip
=
null
;
...
@@ -141,11 +146,11 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -141,11 +146,11 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"tcp参数解析失败!"
);
log
.
error
(
"tcp参数解析失败!"
);
}
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
TCP
+
" "
+
dst_ip
+
" "
+
src_ip
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
TCP
+
" "
+
dst_ip
+
" "
+
src_ip
;
}
}
private
String
udpCmd
(
TestEntity
testEntity
)
{
private
String
udpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"udp"
)){
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"udp"
))
{
return
""
;
return
""
;
}
}
String
dst_ip
=
null
;
String
dst_ip
=
null
;
...
@@ -156,7 +161,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -156,7 +161,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"udp参数解析失败!"
);
log
.
error
(
"udp参数解析失败!"
);
}
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
UDP
+
" "
+
dst_ip
+
" "
+
src_ip
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
UDP
+
" "
+
dst_ip
+
" "
+
src_ip
;
}
}
private
String
tftpCmd
(
TestEntity
testEntity
)
{
private
String
tftpCmd
(
TestEntity
testEntity
)
{
...
@@ -230,7 +235,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -230,7 +235,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"https参数解析失败!"
);
log
.
error
(
"https参数解析失败!"
);
}
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
HTTPS
+
" "
+
src_ip
+
" "
+
src_port
+
" "
+
dst_ip
+
" "
+
dst_port
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
HTTPS
+
" "
+
src_ip
+
" "
+
src_port
+
" "
+
dst_ip
+
" "
+
dst_port
;
}
}
private
String
ipsecCmd
(
TestEntity
testEntity
)
{
private
String
ipsecCmd
(
TestEntity
testEntity
)
{
...
@@ -246,7 +251,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -246,7 +251,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"ipsec参数解析失败!"
);
log
.
error
(
"ipsec参数解析失败!"
);
}
}
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
IPSEC
+
" -s "
+
src_ip
+
" -d "
+
dst_ip
+
" -b "
+
bind_ip
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
IPSEC
+
" -s "
+
src_ip
+
" -d "
+
dst_ip
+
" -b "
+
bind_ip
;
}
}
private
String
pop3Cmd
(
TestEntity
testEntity
)
{
private
String
pop3Cmd
(
TestEntity
testEntity
)
{
...
@@ -648,6 +653,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -648,6 +653,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
return
""
;
return
""
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
HDLC
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
HDLC
;
}
}
//todo need change
//todo need change
private
String
ftpCmd
(
TestEntity
testEntity
)
{
private
String
ftpCmd
(
TestEntity
testEntity
)
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"ftp"
))
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"ftp"
))
...
@@ -728,7 +734,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
...
@@ -728,7 +734,7 @@ public class ProtocolTemplateImpl implements ProtocolTemplateService {
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
BGP
+
src_ip
+
" "
+
src_port
+
" "
+
dst_ip
+
" "
+
dst_port
;
return
kitty
.
getVenvPath
()
+
" "
+
kitty
.
getPath
()
+
ProtocolConstent
.
BGP
+
src_ip
+
" "
+
src_port
+
" "
+
dst_ip
+
" "
+
dst_port
;
}
}
public
String
arpCmd
(
TestEntity
testEntity
)
throws
FuzzException
{
public
String
arpCmd
(
TestEntity
testEntity
)
throws
FuzzException
{
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"arp"
))
if
(!
TestTools
.
paramsLenghtTest
(
testEntity
.
getParamJson
().
length
,
2
,
"arp"
))
return
""
;
return
""
;
String
dst_mac
=
null
;
String
dst_mac
=
null
;
...
...
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/tools/CmdTools.java
View file @
c96a10bd
...
@@ -8,6 +8,7 @@ import com.example.fuzzControll.exception.CmdException;
...
@@ -8,6 +8,7 @@ import com.example.fuzzControll.exception.CmdException;
import
com.example.fuzzControll.exception.FuzzException
;
import
com.example.fuzzControll.exception.FuzzException
;
import
com.example.fuzzControll.pojo.vo.CmdStartParams
;
import
com.example.fuzzControll.pojo.vo.CmdStartParams
;
import
com.example.fuzzControll.pojo.vo.TestReturnEntity
;
import
com.example.fuzzControll.pojo.vo.TestReturnEntity
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.*
;
import
java.io.*
;
...
@@ -15,6 +16,7 @@ import java.util.*;
...
@@ -15,6 +16,7 @@ import java.util.*;
//todo need modify
//todo need modify
@Slf4j
public
class
CmdTools
{
public
class
CmdTools
{
Boolean
send
=
false
;
Boolean
send
=
false
;
WebSocket
socket
=
(
WebSocket
)
SpringContextUtil
.
getBean
(
"WebSocket"
);
WebSocket
socket
=
(
WebSocket
)
SpringContextUtil
.
getBean
(
"WebSocket"
);
...
@@ -67,6 +69,7 @@ public class CmdTools {
...
@@ -67,6 +69,7 @@ public class CmdTools {
printMessageByProgramCmd
(
process
.
getErrorStream
(),
error
);
printMessageByProgramCmd
(
process
.
getErrorStream
(),
error
);
process
.
waitFor
();
process
.
waitFor
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"aflnet run error!"
);
throw
new
FuzzException
(
"run fuzz error !"
);
throw
new
FuzzException
(
"run fuzz error !"
);
}
}
result
.
put
(
"out"
,
out
);
result
.
put
(
"out"
,
out
);
...
...
This diff is collapsed.
Click to expand it.
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