Commit 762d93b3 by 钱炳权

测试通过

parent 4572162c
...@@ -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()) {
before = before + " -K ";
} }
if(algorithmOneCmdParams.getAwareMode()) if (algorithmOneCmdParams.getAwareMode())
before = before+" -E "; before = before + " -E ";
if(algorithmOneCmdParams.getRegionMutationOperators()) if (algorithmOneCmdParams.getRegionMutationOperators())
before = before+" -R "; before = before + " -R ";
if(!"".equals(algorithmOneCmdParams.getScript())) if (!"".equals(algorithmOneCmdParams.getScript()))
before = before+" -c "+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";; 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";
} }
...@@ -164,22 +167,24 @@ public class TestServiceImpl implements TestService { ...@@ -164,22 +167,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 + 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()) {
before = before + " -K ";
} }
if(algorithmOneCmdParams.getAwareMode()) if (algorithmOneCmdParams.getAwareMode())
before = before+" -E "; before = before + " -E ";
if(algorithmOneCmdParams.getRegionMutationOperators()) if (algorithmOneCmdParams.getRegionMutationOperators())
before = before+" -R "; before = before + " -R ";
if(!"".equals(algorithmOneCmdParams.getScript())) if (!"".equals(algorithmOneCmdParams.getScript()))
before = before+" -c "+algorithmOneCmdParams.getScript(); before = before + " -c " + algorithmOneCmdParams.getScript();
before = before+after; 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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment