Commit 762d93b3 by 钱炳权

测试通过

parent 4572162c
......@@ -43,7 +43,7 @@ public class TestServiceImpl implements TestService {
}
log.info("The cmd is [{}]", aflnetCmd);
try {
cmdTools.runProgramCmd(aflnetCmd,"");
cmdTools.runProgramCmd(aflnetCmd, pythonCmd);
} catch (JSchException e) {
throw new RuntimeException(e);
} catch (IOException e) {
......@@ -88,9 +88,9 @@ public class TestServiceImpl implements TestService {
private String dnsCmd(AlgorithmOneCmdParams algorithmOneCmdParams) {
Date date = new Date();
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 "
+ AlgorithmOneCmd.ALFNET_OUTPUT_PATH + "/dnsmasq/src/"+outputFileName;
+ AlgorithmOneCmd.ALFNET_OUTPUT_PATH + "/dnsmasq/src/" + outputFileName;
if (!"".equals(algorithmOneCmdParams.getTrainedModelInputPath())) {
before = before + " -z " + algorithmOneCmdParams.getTrainedModelInputPath();
}
......@@ -117,11 +117,11 @@ public class TestServiceImpl implements TestService {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss-");
String outputFileName = df.format(date) + algorithmOneCmdParams.getProtopcol() + "-output";
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()))
before = before + " -z " + algorithmOneCmdParams.getTrainedModelInputPath();
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()) {
before = before + " -K ";
}
......@@ -141,21 +141,24 @@ public class TestServiceImpl implements TestService {
Date date = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss-");
String outputFileName = df.format(date) + algorithmOneCmdParams.getProtopcol() + "-output";
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()
+" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
+" -N "+algorithmOneCmdParams.getNetinfo()+" -P "+algorithmOneCmdParams.getProtopcol()+" -D "
+algorithmOneCmdParams.getWaiting()+" -d "+" -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo();
if(algorithmOneCmdParams.getKill()){
before = before+" -K ";
}
if(algorithmOneCmdParams.getAwareMode())
before = before+" -E ";
if(algorithmOneCmdParams.getRegionMutationOperators())
before = before+" -R ";
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";;
String before = AlgorithmOneCmd.ALFNET_PATH + " -m none " + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/SMGfuzz/tutorials/lightftp/in-ftp "
+ AlgorithmOneCmd.ALFNET_OUTPUT_PATH + "/LightFTP/Source/Release/" + outputFileName;
if (!"".equals(algorithmOneCmdParams.getTrainedModelInputPath()))
before = before + " -z " + algorithmOneCmdParams.getTrainedModelInputPath();
before = before+" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
+ " -N " + algorithmOneCmdParams.getNetinfo() + " -P " + algorithmOneCmdParams.getProtopcol() + " -D "
+ algorithmOneCmdParams.getWaiting() + " -d " + " -q " + algorithmOneCmdParams.getStateSelectionAlgo() + " -s " + algorithmOneCmdParams.getSeedSelectionAlgo();
if (algorithmOneCmdParams.getKill()) {
before = before + " -K ";
}
if (algorithmOneCmdParams.getAwareMode())
before = before + " -E ";
if (algorithmOneCmdParams.getRegionMutationOperators())
before = before + " -R ";
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 "/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 {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss-");
String outputFileName = df.format(date) + algorithmOneCmdParams.getProtopcol() + "-output";
String before = AlgorithmOneCmd.ALFNET_PATH + AlgorithmOneCmd.ALFNET_INPUT_PATH + "/SMGfuzz/tutorials/live555/in-rtsp "
+AlgorithmOneCmd.ALFNET_OUTPUT_PATH+"/live555/testProgs/"+outputFileName+" -z "+algorithmOneCmdParams.getTrainedModelInputPath()
+" -N "+algorithmOneCmdParams.getNetinfo()+" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict "+" -P "+algorithmOneCmdParams.getProtopcol()+" -m none "+" -D "
+algorithmOneCmdParams.getWaiting()+" -d -r 400";
String after = " -q "+algorithmOneCmdParams.getStateSelectionAlgo()+" -s "+algorithmOneCmdParams.getSeedSelectionAlgo()
+" /home/lddc/SHENYANLONG/live555/testProgs/testOnDemandRTSPServer 8554";
if(algorithmOneCmdParams.getKill()){
before = before+" -K ";
}
if(algorithmOneCmdParams.getAwareMode())
before = before+" -E ";
if(algorithmOneCmdParams.getRegionMutationOperators())
before = before+" -R ";
if(!"".equals(algorithmOneCmdParams.getScript()))
before = before+" -c "+algorithmOneCmdParams.getScript();
before = before+after;
+ AlgorithmOneCmd.ALFNET_OUTPUT_PATH + "/live555/testProgs/" + outputFileName ;
if (!"".equals(algorithmOneCmdParams.getTrainedModelInputPath()))
before = before + " -z " + algorithmOneCmdParams.getTrainedModelInputPath();
before = before+" -N " + algorithmOneCmdParams.getNetinfo() + " -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict " + " -P " + algorithmOneCmdParams.getProtopcol() + " -m none " + " -D "
+ algorithmOneCmdParams.getWaiting() + " -d -r 400";
String after = " -q " + algorithmOneCmdParams.getStateSelectionAlgo() + " -s " + algorithmOneCmdParams.getSeedSelectionAlgo()
+ " /home/lddc/SHENYANLONG/live555/testProgs/testOnDemandRTSPServer 8554";
if (algorithmOneCmdParams.getKill()) {
before = before + " -K ";
}
if (algorithmOneCmdParams.getAwareMode())
before = before + " -E ";
if (algorithmOneCmdParams.getRegionMutationOperators())
before = before + " -R ";
if (!"".equals(algorithmOneCmdParams.getScript()))
before = before + " -c " + algorithmOneCmdParams.getScript();
before = before + after;
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";
}
......@@ -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";
log.info("The cmd is [{}]", finalCmd);
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) {
throw new RuntimeException(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