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
762d93b3
Commit
762d93b3
authored
Jun 16, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试通过
parent
4572162c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
36 deletions
+41
-36
TestServiceImpl.java
...om/example/fuzzControll/service/impl/TestServiceImpl.java
+41
-36
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/TestServiceImpl.java
View file @
762d93b3
...
@@ -43,7 +43,7 @@ public class TestServiceImpl implements TestService {
...
@@ -43,7 +43,7 @@ public class TestServiceImpl implements TestService {
}
}
log
.
info
(
"The cmd is [{}]"
,
aflnetCmd
);
log
.
info
(
"The cmd is [{}]"
,
aflnetCmd
);
try
{
try
{
cmdTools
.
runProgramCmd
(
aflnetCmd
,
""
);
cmdTools
.
runProgramCmd
(
aflnetCmd
,
pythonCmd
);
}
catch
(
JSchException
e
)
{
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -88,9 +88,9 @@ public class TestServiceImpl implements TestService {
...
@@ -88,9 +88,9 @@ public class TestServiceImpl implements TestService {
private
String
dnsCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
private
String
dnsCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()+
"-output"
;
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
" -d "
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/dnsmasq/in-dns "
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
" -d "
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/dnsmasq/in-dns "
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/dnsmasq/src/"
+
outputFileName
;
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/dnsmasq/src/"
+
outputFileName
;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
{
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
{
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
}
}
...
@@ -117,11 +117,11 @@ public class TestServiceImpl implements TestService {
...
@@ -117,11 +117,11 @@ public class TestServiceImpl implements TestService {
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/kamailio/in-sip "
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/kamailio/in-sip "
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/kamailio/"
+
outputFileName
;
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/kamailio/"
+
outputFileName
;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
before
=
before
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()
+
" -m none -t 3000+ "
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()
+
" -l 5061 "
+
" -D "
before
=
before
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()
+
" -m none -t 3000+ "
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()
+
" -l 5061 "
+
" -D "
+
algorithmOneCmdParams
.
getWaiting
()
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()
+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
+
algorithmOneCmdParams
.
getWaiting
()
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()
+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
if
(
algorithmOneCmdParams
.
getKill
())
{
if
(
algorithmOneCmdParams
.
getKill
())
{
before
=
before
+
" -K "
;
before
=
before
+
" -K "
;
}
}
...
@@ -141,21 +141,24 @@ public class TestServiceImpl implements TestService {
...
@@ -141,21 +141,24 @@ public class TestServiceImpl implements TestService {
Date
date
=
new
Date
();
Date
date
=
new
Date
();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
" -m none "
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/SMGfuzz/tutorials/lightftp/in-ftp "
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
" -m none "
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/SMGfuzz/tutorials/lightftp/in-ftp "
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/LightFTP/Source/Release/"
+
outputFileName
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
()
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/LightFTP/Source/Release/"
+
outputFileName
;
+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()+
" -D "
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
+
algorithmOneCmdParams
.
getWaiting
()+
" -d "
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
before
=
before
+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
if
(
algorithmOneCmdParams
.
getKill
()){
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()
+
" -D "
before
=
before
+
" -K "
;
+
algorithmOneCmdParams
.
getWaiting
()
+
" -d "
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()
+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
}
if
(
algorithmOneCmdParams
.
getKill
())
{
if
(
algorithmOneCmdParams
.
getAwareMode
())
before
=
before
+
" -K "
;
before
=
before
+
" -E "
;
}
if
(
algorithmOneCmdParams
.
getRegionMutationOperators
())
if
(
algorithmOneCmdParams
.
getAwareMode
())
before
=
before
+
" -R "
;
before
=
before
+
" -E "
;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getScript
()))
if
(
algorithmOneCmdParams
.
getRegionMutationOperators
())
before
=
before
+
" -c "
+
algorithmOneCmdParams
.
getScript
();
before
=
before
+
" -R "
;
before
=
before
+
" /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp.conf 2200"
;;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getScript
()))
before
=
before
+
" -c "
+
algorithmOneCmdParams
.
getScript
();
before
=
before
+
" /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp /home/lddc/SHENYANLONG/LightFTP/Source/Release/fftp.conf 2200"
;
;
return
before
;
return
before
;
// 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";
// 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";
}
}
...
@@ -165,21 +168,23 @@ public class TestServiceImpl implements TestService {
...
@@ -165,21 +168,23 @@ public class TestServiceImpl implements TestService {
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
outputFileName
=
df
.
format
(
date
)
+
algorithmOneCmdParams
.
getProtopcol
()
+
"-output"
;
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/SMGfuzz/tutorials/live555/in-rtsp "
String
before
=
AlgorithmOneCmd
.
ALFNET_PATH
+
AlgorithmOneCmd
.
ALFNET_INPUT_PATH
+
"/SMGfuzz/tutorials/live555/in-rtsp "
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/live555/testProgs/"
+
outputFileName
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
()
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/live555/testProgs/"
+
outputFileName
;
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict "
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()+
" -m none "
+
" -D "
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getTrainedModelInputPath
()))
+
algorithmOneCmdParams
.
getWaiting
()+
" -d -r 400"
;
before
=
before
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
();
String
after
=
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
()
before
=
before
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()
+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict "
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()
+
" -m none "
+
" -D "
+
" /home/lddc/SHENYANLONG/live555/testProgs/testOnDemandRTSPServer 8554"
;
+
algorithmOneCmdParams
.
getWaiting
()
+
" -d -r 400"
;
if
(
algorithmOneCmdParams
.
getKill
()){
String
after
=
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()
+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
()
before
=
before
+
" -K "
;
+
" /home/lddc/SHENYANLONG/live555/testProgs/testOnDemandRTSPServer 8554"
;
}
if
(
algorithmOneCmdParams
.
getKill
())
{
if
(
algorithmOneCmdParams
.
getAwareMode
())
before
=
before
+
" -K "
;
before
=
before
+
" -E "
;
}
if
(
algorithmOneCmdParams
.
getRegionMutationOperators
())
if
(
algorithmOneCmdParams
.
getAwareMode
())
before
=
before
+
" -R "
;
before
=
before
+
" -E "
;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getScript
()))
if
(
algorithmOneCmdParams
.
getRegionMutationOperators
())
before
=
before
+
" -c "
+
algorithmOneCmdParams
.
getScript
();
before
=
before
+
" -R "
;
before
=
before
+
after
;
if
(!
""
.
equals
(
algorithmOneCmdParams
.
getScript
()))
before
=
before
+
" -c "
+
algorithmOneCmdParams
.
getScript
();
before
=
before
+
after
;
return
before
;
return
before
;
// 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";
// 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";
}
}
...
@@ -195,7 +200,7 @@ public class TestServiceImpl implements TestService {
...
@@ -195,7 +200,7 @@ public class TestServiceImpl implements TestService {
String
finalCmd
=
CmdConstent
.
RUN_AFLNET_BEFORE
+
outputFileName
+
CmdConstent
.
RUN_AFLNET_AFTER
+
cmd
+
aflnetProperties
.
getAflnetPath
()
+
"live555/testProgs/testOnDemandRTSPServer 8554"
;
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
{
try
{
cmdTools
.
runProgramCmd
(
"
source /etc/profile && "
+
finalCmd
,
""
);
cmdTools
.
runProgramCmd
(
"
/home/lddc/nemo/profuzzbench/SMGfuzz/afl-fuzz -d -i /home/lddc/nemo/profuzzbench/subjects/DNS/Dnsmasq/in-dns -o /home/lddc/SHENYANLONG/dnsmasq/src/output_dnsmasq_RLGfuzz -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\n"
,
""
);
}
catch
(
JSchException
e
)
{
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
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