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
2b6461e2
Commit
2b6461e2
authored
Jun 13, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ssh至服务器并成功调用服务
parent
336793c0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
251 additions
and
59 deletions
+251
-59
AlgorithmOneCmd.java
...a/com/example/fuzzControll/constents/AlgorithmOneCmd.java
+7
-0
AlfnetController.java
...com/example/fuzzControll/controller/AlfnetController.java
+28
-8
AlgorithmOneCmdParams.java
...m/example/fuzzControll/pojo/vo/AlgorithmOneCmdParams.java
+41
-0
AlgorithmTwoCmdParams.java
...m/example/fuzzControll/pojo/vo/AlgorithmTwoCmdParams.java
+1
-1
TestService.java
...in/java/com/example/fuzzControll/service/TestService.java
+3
-5
TestServiceImpl.java
...om/example/fuzzControll/service/impl/TestServiceImpl.java
+132
-10
CmdTools.java
...rc/main/java/com/example/fuzzControll/tools/CmdTools.java
+20
-23
LinuxCommandUtil.java
...java/com/example/fuzzControll/tools/LinuxCommandUtil.java
+9
-8
application-dev.yml
fuzzIntegration/src/main/resources/application-dev.yml
+10
-4
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/constents/AlgorithmOneCmd.java
0 → 100644
View file @
2b6461e2
package
com
.
example
.
fuzzControll
.
constents
;
public
class
AlgorithmOneCmd
{
public
static
final
String
ALFNET_PATH
=
"/home/lddc/SHENYANLONG/SMGfuzz/afl-fuzz "
;
//aflnet服务启动路径
public
static
final
String
ALFNET_INPUT_PATH
=
" -i /home/lddc/SHENYANLONG"
;
//aflnet种子根路径
public
static
final
String
ALFNET_OUTPUT_PATH
=
" -o /home/lddc/SHENYANLONG"
;
//aflnet种子根路径
}
fuzzIntegration/src/main/java/com/example/fuzzControll/controller/AlfnetController.java
View file @
2b6461e2
...
...
@@ -4,9 +4,8 @@ import com.example.fuzzControll.exception.AflnetException;
import
com.example.fuzzControll.exception.BaseException
;
import
com.example.fuzzControll.exception.CmdException
;
import
com.example.fuzzControll.pojo.vo.AjaxResult
;
import
com.example.fuzzControll.pojo.vo.
CmdStart
Params
;
import
com.example.fuzzControll.pojo.vo.
AlgorithmOneCmd
Params
;
import
com.example.fuzzControll.service.TestService
;
import
com.example.fuzzControll.tools.GlobalParameters
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -25,17 +24,16 @@ public class AlfnetController {
TestService
service
;
/**
*
测试启动
*
算法1 有参数型
*/
@RequestMapping
(
value
=
"/testStart"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
start
(
@RequestBody
final
CmdStartParams
cmdStartParams
)
{
System
.
out
.
println
(
cmdStartParams
);
//todo 捕获子线程错误
@RequestMapping
(
value
=
"/algorithmOneStart"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
algorithmOneStart
(
@RequestBody
final
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
System
.
out
.
println
(
algorithmOneCmdParams
);
try
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
service
.
testStart
(
cmdStart
Params
);
service
.
algorithmOneStart
(
algorithmOneCmd
Params
);
}
}).
start
();
}
catch
(
Exception
e
)
{
...
...
@@ -48,6 +46,28 @@ public class AlfnetController {
}
/**
* 算法2 无参数型
*/
@RequestMapping
(
value
=
"/algorithmTwoStart"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
algorithmTwoStart
(
@RequestBody
final
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
System
.
out
.
println
(
algorithmOneCmdParams
);
//todo 捕获子线程错误
try
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
service
.
algorithmTwoStart
(
algorithmOneCmdParams
);
}
}).
start
();
}
catch
(
Exception
e
)
{
if
(
e
instanceof
AflnetException
||
e
instanceof
CmdException
)
{
log
.
error
(((
BaseException
)
e
).
getDefaultMessage
());
}
return
AjaxResult
.
error
(
"测试启动失败!"
);
}
return
AjaxResult
.
success
(
"测试已启动!"
);
}
/**
* 测试停止
*/
@RequestMapping
(
value
=
"/testStop"
,
method
=
RequestMethod
.
GET
)
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/pojo/vo/AlgorithmOneCmdParams.java
0 → 100644
View file @
2b6461e2
package
com
.
example
.
fuzzControll
.
pojo
.
vo
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
@Data
@Getter
@Setter
public
class
AlgorithmOneCmdParams
{
String
netinfo
;
//netInfo
String
protopcol
;
//protocol
int
waiting
;
//usec
String
nsname
;
//netnsname
Boolean
kill
;
Boolean
awareMode
;
Boolean
regionMutationOperators
;
Boolean
falseNegativeMode
;
String
script
;
//script
int
stateSelectionAlgo
;
int
seedSelectionAlgo
;
String
trainedModelInputPath
;
@Override
public
String
toString
()
{
return
"AlgorithmTwoCmdParams{"
+
"netinfo='"
+
netinfo
+
'\''
+
", protopcol='"
+
protopcol
+
'\''
+
", waiting="
+
waiting
+
", nsname='"
+
nsname
+
'\''
+
", kill="
+
kill
+
", awareMode="
+
awareMode
+
", regionMutationOperators="
+
regionMutationOperators
+
", falseNegativeMode="
+
falseNegativeMode
+
", script='"
+
script
+
'\''
+
", stateSelectionAlgo="
+
stateSelectionAlgo
+
", seedSelectionAlgo="
+
seedSelectionAlgo
+
", trainedModelInputPath='"
+
trainedModelInputPath
+
'\''
+
'}'
;
}
}
fuzzIntegration/src/main/java/com/example/fuzzControll/pojo/vo/
CmdStart
Params.java
→
fuzzIntegration/src/main/java/com/example/fuzzControll/pojo/vo/
AlgorithmTwoCmd
Params.java
View file @
2b6461e2
...
...
@@ -7,7 +7,7 @@ import lombok.Setter;
@Data
@Getter
@Setter
public
class
CmdStart
Params
{
public
class
AlgorithmTwoCmd
Params
{
String
netinfo
;
//netInfo
String
protopcol
;
//protocol
int
waiting
;
//usec
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/service/TestService.java
View file @
2b6461e2
package
com
.
example
.
fuzzControll
.
service
;
import
com.example.fuzzControll.pojo.vo.CmdStartParams
;
import
java.util.concurrent.CountDownLatch
;
import
com.example.fuzzControll.pojo.vo.AlgorithmOneCmdParams
;
public
interface
TestService
{
void
testStart
(
CmdStartParams
cmdStart
Params
);
void
algorithmOneStart
(
AlgorithmOneCmdParams
algorithmOneCmd
Params
);
void
algorithmTwoStart
(
AlgorithmOneCmdParams
algorithmOneCmdParams
);
void
testStop
();
}
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/TestServiceImpl.java
View file @
2b6461e2
package
com
.
example
.
fuzzControll
.
service
.
impl
;
import
com.example.fuzzControll.conf.AflnetProperties
;
import
com.example.fuzzControll.constents.AlgorithmOneCmd
;
import
com.example.fuzzControll.constents.CmdConstent
;
import
com.example.fuzzControll.exception.AflnetException
;
import
com.example.fuzzControll.exception.CmdException
;
import
com.example.fuzzControll.pojo.vo.CmdStartParams
;
import
com.example.fuzzControll.pojo.vo.AlgorithmOneCmdParams
;
import
com.example.fuzzControll.service.TestService
;
import
com.example.fuzzControll.tools.CmdTools
;
import
com.example.fuzzControll.tools.GlobalParameters
;
import
com.example.fuzzControll.tools.TestControlTools
;
import
com.jcraft.jsch.JSchException
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -18,7 +17,6 @@ import java.io.IOException;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
@Service
(
"testService"
)
@Slf4j
...
...
@@ -29,18 +27,143 @@ public class TestServiceImpl implements TestService {
@Autowired
AflnetProperties
aflnetProperties
;
@Override
public
void
algorithmOneStart
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
TestControlTools
.
setIsRunning
(
true
);
String
finalCmd
=
getAlgorithmOneFinalCmd
(
algorithmOneCmdParams
);
if
(
finalCmd
==
null
)
{
log
.
error
(
"AlgorithmOne Cmd is null!"
);
throw
new
AflnetException
(
"Cmd Generate error!"
);
}
log
.
info
(
"The cmd is [{}]"
,
finalCmd
);
try
{
cmdTools
.
runProgramCmd
(
finalCmd
);
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
private
String
getAlgorithmOneFinalCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
switch
(
algorithmOneCmdParams
.
getProtopcol
().
toLowerCase
())
{
case
"dns"
:
return
dnsCmd
(
algorithmOneCmdParams
);
case
"sip"
:
return
sipCmd
(
algorithmOneCmdParams
);
case
"ftp"
:
return
ftpCmd
(
algorithmOneCmdParams
);
case
"rtsp"
:
return
rtspCmd
(
algorithmOneCmdParams
);
default
:
return
null
;
//todo 增加其他协议 的格式
}
}
private
String
dnsCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
// String before = AlgorithmOneCmd.ALFNET_PATH + " -d " + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/dnsmasq/in-dns "
// +AlgorithmOneCmd.ALFNET_OUTPUT_PATH+"/dnsmasq/src/output_dnsmasq_RLGfuzz"+" -z "+algorithmOneCmdParams.getTrainedModelInputPath()
// +" -N "+algorithmOneCmdParams.getNetinfo()+" -m none "+" -P "+algorithmOneCmdParams.getProtopcol()+" -D "
// +algorithmOneCmdParams.getWaiting();
// String after = " -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo()+" -r '4' /home/lddc/SHENYANLONG/dnsmasq/src/dnsmasq";
// String finalCmd = before;
// if(algorithmOneCmdParams.getKill()){
// finalCmd = finalCmd+" -K ";
// }
// if(algorithmOneCmdParams.getAwareMode())
// finalCmd = finalCmd+" -E ";
// if(algorithmOneCmdParams.getRegionMutationOperators())
// finalCmd = finalCmd+" -R ";
// if(!"".equals(algorithmOneCmdParams.getScript()))
// finalCmd = finalCmd+" -c "+algorithmOneCmdParams.getScript();
// if(!"".equals(algorithmOneCmdParams.getTrainedModelInputPath()))
// finalCmd = finalCmd+" -c "+algorithmOneCmdParams.getScript();
// finalCmd = finalCmd+after;
// return finalCmd;
return
"/home/lddc/SHENYANLONG/SMGfuzz/afl-fuzz -d -i /home/lddc/SHENYANLONG/dnsmasq/in-dns -o /home/lddc/SHENYANLONG/dnsmasq/src/output_dnsmasq_RLGfuzz -z /home/lddc/SHENYANLONG/SMGfuzz/RL_Pytorch/Train_Result/dnsmasq/RL_Result -N udp://127.0.0.1/5353 -m none -P DNS -D 10000 -K -E -R -q 4 -s 4 -r '4' /home/lddc/SHENYANLONG/dnsmasq/src/dnsmasq"
;
}
private
String
sipCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
// String before = AlgorithmOneCmd.ALFNET_PATH + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/kamailio/in-sip "
// +AlgorithmOneCmd.ALFNET_OUTPUT_PATH+"/kamailio/output_kamailio_RLGfuzz"+" -z "+algorithmOneCmdParams.getTrainedModelInputPath()
// +" -N "+algorithmOneCmdParams.getNetinfo()+" -m none -t 3000+ "+" -P "+algorithmOneCmdParams.getProtopcol()+" -l 5061 "+" -D "
// +algorithmOneCmdParams.getWaiting()+" -d ";
// String after = " -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo()
// +" /home/lddc/SHENYANLONG/kamailio/src/kamailio -f /home/lddc/SHENYANLONG/kamailio/kamailio-basic.cfg -L /home/lddc/SHENYANLONG/kamailio/src/modules -n 1 -Y /home/lddc/SHENYANLONG/kamailio/runtime_dir";
// String finalCmd = before;
// if(algorithmOneCmdParams.getKill()){
// finalCmd = finalCmd+" -K ";
// }
// if(algorithmOneCmdParams.getAwareMode())
// finalCmd = finalCmd+" -E ";
// if(algorithmOneCmdParams.getRegionMutationOperators())
// finalCmd = finalCmd+" -R ";
// if(!"".equals(algorithmOneCmdParams.getScript()))
// finalCmd = finalCmd+" -c "+algorithmOneCmdParams.getScript();
// finalCmd = finalCmd+after;
// return finalCmd;
return
"/home/lddc/SHENYANLONG/SMGfuzz/afl-fuzz -i /home/lddc/SHENYANLONG/kamailio/in-sip -o /home/lddc/SHENYANLONG/kamailio/output_kamailio_RLGfuzz -z /home/lddc/SHENYANLONG/SMGfuzz/RL_Pytorch/Train_Result/kamailio/RL_Result -N udp://127.0.0.1/5060 -m none -t 3000+ -P SIP -l 5061 -D 50000 -q 4 -s 4 -E -K -R -d -c /home/lddc/SHENYANLONG/kamailio/run_pjsip.sh /home/lddc/SHENYANLONG/kamailio/src/kamailio -f /home/lddc/SHENYANLONG/kamailio/kamailio-basic.cfg -L /home/lddc/SHENYANLONG/kamailio/src/modules -n 1 -Y /home/lddc/SHENYANLONG/kamailio/runtime_dir"
;
}
private
String
ftpCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
// String before = AlgorithmOneCmd.ALFNET_PATH + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/SMGfuzz/tutorials/lightftp/in-ftp "
// +AlgorithmOneCmd.ALFNET_OUTPUT_PATH+"/LightFTP/Source/Release/output_lightftp_RLGfuzz"+" -z "+algorithmOneCmdParams.getTrainedModelInputPath()
// +" -N "+algorithmOneCmdParams.getNetinfo()+" -m none "+" -P "+algorithmOneCmdParams.getProtopcol()+" -l 5061 "+" -D "
// +algorithmOneCmdParams.getWaiting()+" -d ";
// String after = " -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo()
// +" /home/lddc/SHENYANLONG/kamailio/src/kamailio -f /home/lddc/SHENYANLONG/kamailio/kamailio-basic.cfg -L /home/lddc/SHENYANLONG/kamailio/src/modules -n 1 -Y /home/lddc/SHENYANLONG/kamailio/runtime_dir";
// String finalCmd = before;
// if(algorithmOneCmdParams.getKill()){
// finalCmd = finalCmd+" -K ";
// }
// if(algorithmOneCmdParams.getAwareMode())
// finalCmd = finalCmd+" -E ";
// if(algorithmOneCmdParams.getRegionMutationOperators())
// finalCmd = finalCmd+" -R ";
// if(!"".equals(algorithmOneCmdParams.getScript()))
// finalCmd = finalCmd+" -c "+algorithmOneCmdParams.getScript();
// finalCmd = finalCmd+after;
// return finalCmd;
return
"/home/lddc/SHENYANLONG/SMGfuzz/afl-fuzz -m none -i /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/in-ftp -o /home/lddc/SHENYANLONG/LightFTP/Source/Release/output_lightftp_RLGfuzz -N tcp://127.0.0.1/2200 -z /home/lddc/SHENYANLONG/SMGfuzz/RL_Pytorch/Train_Result/lightftp/RL_Result -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict -P FTP -D 10000 -q 4 -s 4 -E -K -R -d -c /home/lddc/SHENYANLONG/LightFTP/Source/Release/ftpclean.sh /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp.conf 2200"
;
}
private
String
rtspCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
// String before = AlgorithmOneCmd.ALFNET_PATH + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/kamailio/in-sip "
// +AlgorithmOneCmd.ALFNET_OUTPUT_PATH+"/kamailio/output_kamailio_RLGfuzz"+" -z "+algorithmOneCmdParams.getTrainedModelInputPath()
// +" -N "+algorithmOneCmdParams.getNetinfo()+" -m none -t 3000+ "+" -P "+algorithmOneCmdParams.getProtopcol()+" -l 5061 "+" -D "
// +algorithmOneCmdParams.getWaiting()+" -d ";
// String after = " -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo()
// +" /home/lddc/SHENYANLONG/kamailio/src/kamailio -f /home/lddc/SHENYANLONG/kamailio/kamailio-basic.cfg -L /home/lddc/SHENYANLONG/kamailio/src/modules -n 1 -Y /home/lddc/SHENYANLONG/kamailio/runtime_dir";
// String finalCmd = before;
// if(algorithmOneCmdParams.getKill()){
// finalCmd = finalCmd+" -K ";
// }
// if(algorithmOneCmdParams.getAwareMode())
// finalCmd = finalCmd+" -E ";
// if(algorithmOneCmdParams.getRegionMutationOperators())
// finalCmd = finalCmd+" -R ";
// if(!"".equals(algorithmOneCmdParams.getScript()))
// finalCmd = finalCmd+" -c "+algorithmOneCmdParams.getScript();
// finalCmd = finalCmd+after;
// return finalCmd;
return
"/home/lddc/SHENYANLONG/SMGfuzz/afl-fuzz -i /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/in-rtsp -o /home/lddc/SHENYANLONG/live555/testProgs/output_live555_RLGfuzz -z /home/lddc/SHENYANLONG/SMGfuzz/RL_Pytorch/Train_Result/live555/RL_Result -N tcp://127.0.0.1/8554 -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict -m none -D 10000 -K -E -R -q 4 -s 4 -d /home/lddc/SHENYANLONG/live555/testProgs/testOnDemandRTSPServer 85540"
;
}
//todo 不同服务不同端口
@Override
public
void
testStart
(
CmdStartParams
cmdStartParams
)
{
public
void
algorithmTwoStart
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
TestControlTools
.
setIsRunning
(
true
);
String
cmd
=
cmdTools
.
parse
(
cmdStart
Params
);
String
cmd
=
cmdTools
.
parse
(
algorithmOneCmd
Params
);
Date
date
=
new
Date
();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
cmdStartParams
.
getProtopcol
()+
"-output"
;
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
finalCmd
=
CmdConstent
.
RUN_AFLNET_BEFORE
+
outputFileName
+
CmdConstent
.
RUN_AFLNET_AFTER
+
cmd
+
aflnetProperties
.
getAflnetPath
()
+
"live555/testProgs/testOnDemandRTSPServer 8554"
;
log
.
info
(
"The cmd is [{}]"
,
finalCmd
);
log
.
info
(
"The cmd is [{}]"
,
finalCmd
);
try
{
cmdTools
.
runProgramCmd
(
"source /etc/profile && "
+
finalCmd
);
cmdTools
.
runProgramCmd
(
"source /etc/profile && "
+
finalCmd
);
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
...
...
@@ -49,7 +172,6 @@ public class TestServiceImpl implements TestService {
}
@Override
public
void
testStop
()
{
TestControlTools
.
setIsRunning
(
false
);
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/tools/CmdTools.java
View file @
2b6461e2
package
com
.
example
.
fuzzControll
.
tools
;
import
com.alibaba.fastjson.JSONObject
;
import
com.example.fuzzControll.conf.AflnetSshProperties
;
import
com.example.fuzzControll.exception.AflnetException
;
import
com.example.fuzzControll.exception.CmdException
;
import
com.example.fuzzControll.pojo.vo.*
;
import
com.jcraft.jsch.JSchException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
//todo need modify
...
...
@@ -88,46 +85,46 @@ public class CmdTools {
}
public
String
parse
(
CmdStartParams
cmdStart
Params
)
throws
AflnetException
{
if
(
cmdStart
Params
==
null
)
{
public
String
parse
(
AlgorithmOneCmdParams
algorithmOneCmd
Params
)
throws
AflnetException
{
if
(
algorithmOneCmd
Params
==
null
)
{
throw
new
AflnetException
(
"CmdStartParams is null !"
);
}
StringBuilder
cmd
=
new
StringBuilder
();
if
(
cmdStartParams
.
getNetinfo
()
!=
""
&&
cmdStart
Params
.
getNetinfo
()
!=
null
)
{
cmd
.
append
(
" -N "
+
cmdStart
Params
.
getNetinfo
());
if
(
algorithmOneCmdParams
.
getNetinfo
()
!=
""
&&
algorithmOneCmd
Params
.
getNetinfo
()
!=
null
)
{
cmd
.
append
(
" -N "
+
algorithmOneCmd
Params
.
getNetinfo
());
}
else
{
log
.
error
(
"There is no netinfo !"
);
throw
new
AflnetException
(
"There is no netinfo !"
);
}
if
(
cmdStart
Params
.
getProtopcol
()
!=
""
)
{
cmd
.
append
(
" -P "
+
cmdStart
Params
.
getProtopcol
());
if
(
algorithmOneCmd
Params
.
getProtopcol
()
!=
""
)
{
cmd
.
append
(
" -P "
+
algorithmOneCmd
Params
.
getProtopcol
());
}
if
(
cmdStart
Params
.
getWaiting
()
!=
0
)
{
cmd
.
append
(
" -D "
+
cmdStart
Params
.
getWaiting
());
if
(
algorithmOneCmd
Params
.
getWaiting
()
!=
0
)
{
cmd
.
append
(
" -D "
+
algorithmOneCmd
Params
.
getWaiting
());
}
if
(
cmdStart
Params
.
getNsname
()
!=
""
)
{
cmd
.
append
(
" -e "
+
cmdStart
Params
.
getNsname
());
if
(
algorithmOneCmd
Params
.
getNsname
()
!=
""
)
{
cmd
.
append
(
" -e "
+
algorithmOneCmd
Params
.
getNsname
());
}
if
(
cmdStart
Params
.
getKill
())
{
if
(
algorithmOneCmd
Params
.
getKill
())
{
cmd
.
append
(
" -K "
);
}
if
(
cmdStart
Params
.
getAwareMode
())
{
if
(
algorithmOneCmd
Params
.
getAwareMode
())
{
cmd
.
append
(
" -E "
);
}
if
(
cmdStart
Params
.
getRegionMutationOperators
())
{
if
(
algorithmOneCmd
Params
.
getRegionMutationOperators
())
{
cmd
.
append
(
" -R "
);
}
if
(
cmdStart
Params
.
getFalseNegativeMode
())
{
if
(
algorithmOneCmd
Params
.
getFalseNegativeMode
())
{
cmd
.
append
(
" -F "
);
}
if
(
cmdStart
Params
.
getScript
()
!=
""
)
{
cmd
.
append
(
" -c "
+
cmdStart
Params
.
getScript
());
if
(
algorithmOneCmd
Params
.
getScript
()
!=
""
)
{
cmd
.
append
(
" -c "
+
algorithmOneCmd
Params
.
getScript
());
}
if
(
cmdStart
Params
.
getStateSelectionAlgo
()
!=
0
)
{
cmd
.
append
(
" -q "
+
cmdStart
Params
.
getStateSelectionAlgo
());
if
(
algorithmOneCmd
Params
.
getStateSelectionAlgo
()
!=
0
)
{
cmd
.
append
(
" -q "
+
algorithmOneCmd
Params
.
getStateSelectionAlgo
());
}
if
(
cmdStart
Params
.
getSeedSelectionAlgo
()
!=
0
)
{
cmd
.
append
(
" -s "
+
cmdStart
Params
.
getSeedSelectionAlgo
()
+
" "
);
if
(
algorithmOneCmd
Params
.
getSeedSelectionAlgo
()
!=
0
)
{
cmd
.
append
(
" -s "
+
algorithmOneCmd
Params
.
getSeedSelectionAlgo
()
+
" "
);
}
return
cmd
.
toString
();
}
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/tools/LinuxCommandUtil.java
View file @
2b6461e2
...
...
@@ -94,14 +94,15 @@ public class LinuxCommandUtil {
TestReturnEntity
returnEntity
=
new
TestReturnEntity
();
try
{
while
((
line
=
bf
.
readLine
())
!=
null
&&
TestControlTools
.
getIsRunning
())
{
cmdTools
.
makeReturnEntity
(
line
,
returnEntity
);
if
(
cmdTools
.
send
)
{
String
data
=
JSONObject
.
toJSONString
(
returnEntity
);
try
{
GlobalParameters
.
webSocket
.
appointSending
(
"fuzzMaster"
,
"web"
,
data
);
}
catch
(
Exception
ignored
)
{
}
}
System
.
out
.
println
(
line
);
// cmdTools.makeReturnEntity(line, returnEntity);
// if (cmdTools.send) {
// String data = JSONObject.toJSONString(returnEntity);
// try {
// GlobalParameters.webSocket.appointSending("fuzzMaster", "web", data);
// } catch (Exception ignored) {
// }
// }
}
//结束就关闭
if
(!
TestControlTools
.
getIsRunning
()){
...
...
fuzzIntegration/src/main/resources/application-dev.yml
View file @
2b6461e2
...
...
@@ -22,7 +22,13 @@ web:
ip
:
192.168.9.177
aflnetssh
:
host
:
192.168.
9.177
host
:
192.168.
31.53
port
:
22
user
:
root
password
:
123456
\ No newline at end of file
user
:
lddc
password
:
sysulddc
#aflnetssh:
# host: 192.168.31.133
# port: 22
# user: root
# password: 123456
\ 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