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
aba81cda
Commit
aba81cda
authored
Jun 17, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
算法2能够测试
parent
762d93b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
9 deletions
+51
-9
TestService.java
...in/java/com/example/fuzzControll/service/TestService.java
+2
-1
TestServiceImpl.java
...om/example/fuzzControll/service/impl/TestServiceImpl.java
+49
-8
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/service/TestService.java
View file @
aba81cda
package
com
.
example
.
fuzzControll
.
service
;
import
com.example.fuzzControll.pojo.vo.AlgorithmOneCmdParams
;
import
com.example.fuzzControll.pojo.vo.AlgorithmTwoCmdParams
;
public
interface
TestService
{
void
algorithmOneStart
(
Algorithm
OneCmdParams
algorithmOne
CmdParams
);
void
algorithmOneStart
(
Algorithm
TwoCmdParams
algorithmTwo
CmdParams
);
void
algorithmTwoStart
(
AlgorithmOneCmdParams
algorithmOneCmdParams
);
void
testStop
();
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/TestServiceImpl.java
View file @
aba81cda
...
...
@@ -5,6 +5,7 @@ import com.example.fuzzControll.constents.AlgorithmOneCmd;
import
com.example.fuzzControll.constents.CmdConstent
;
import
com.example.fuzzControll.exception.AflnetException
;
import
com.example.fuzzControll.pojo.vo.AlgorithmOneCmdParams
;
import
com.example.fuzzControll.pojo.vo.AlgorithmTwoCmdParams
;
import
com.example.fuzzControll.service.TestService
;
import
com.example.fuzzControll.tools.CmdTools
;
import
com.example.fuzzControll.tools.TestControlTools
;
...
...
@@ -191,24 +192,64 @@ public class TestServiceImpl implements TestService {
//todo 不同服务不同端口
@Override
public
void
algorithmOneStart
(
Algorithm
OneCmdParams
algorithmOne
CmdParams
)
{
public
void
algorithmOneStart
(
Algorithm
TwoCmdParams
algorithmTwo
CmdParams
)
{
TestControlTools
.
setIsRunning
(
true
);
String
cmd
=
cmdTools
.
parse
(
algorithmOne
CmdParams
);
Date
date
=
new
Date
();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-
"
);
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 [{}]"
,
final
Cmd
);
String
aflnetCmd
=
getAlgorithmOneFinalCmd
(
algorithmTwo
CmdParams
);
if
(
aflnetCmd
==
null
)
{
log
.
error
(
"AlgorithmOne Cmd is null!
"
);
throw
new
AflnetException
(
"Cmd Generate error!"
)
;
}
log
.
info
(
"The cmd is [{}]"
,
aflnet
Cmd
);
try
{
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"
,
""
);
cmdTools
.
runProgramCmd
(
aflnetCmd
,
""
);
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
// TestControlTools.setIsRunning(true);
// String cmd = cmdTools.parse(algorithmOneCmdParams);
// Date date = new Date();
// DateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss-");
// String outputFileName = df.format(date) + algorithmOneCmdParams.getProtopcol() + "-output";
// String finalCmd = "/home/lddc/nemo/profuzzbench/SMGfuzz/afl-fuzz -d -i /home/lddc/nemo/profuzzbench/subjects/DNS/Dnsmasq/in-dns -o /home/lddc/SHENYANLONG/dnsmasq/src"+ outputFileName +" -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";
// log.info("The cmd is [{}]", finalCmd);
// try {
// 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) {
// throw new RuntimeException(e);
// }
}
private
String
getAlgorithmOneFinalCmd
(
AlgorithmTwoCmdParams
algorithmTwoCmdParams
)
{
switch
(
algorithmTwoCmdParams
.
getProtopcol
().
toLowerCase
())
{
case
"dns"
:
return
dnsOne
(
algorithmTwoCmdParams
);
case
"sip"
:
return
""
;
case
"ftp"
:
return
""
;
case
"rtsp"
:
return
""
;
default
:
return
null
;
//todo 增加其他协议 的格式
}
}
private
String
dnsOne
(
AlgorithmTwoCmdParams
algorithmTwoCmdParams
)
{
TestControlTools
.
setIsRunning
(
true
);
Date
date
=
new
Date
();
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd-hh-mm-ss-"
);
String
outputFileName
=
df
.
format
(
date
)
+
algorithmTwoCmdParams
.
getProtopcol
()
+
"-output"
;
String
finalCmd
=
"/home/lddc/nemo/profuzzbench/SMGfuzz/afl-fuzz -d -i /home/lddc/nemo/profuzzbench/subjects/DNS/Dnsmasq/in-dns -o /home/lddc/SHENYANLONG/dnsmasq/src"
+
outputFileName
+
" -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"
;
log
.
info
(
"The cmd is [{}]"
,
finalCmd
);
return
finalCmd
;
}
@Override
public
void
testStop
()
{
TestControlTools
.
setIsRunning
(
false
);
...
...
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