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
4572162c
Commit
4572162c
authored
Jun 16, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试通过
parent
41472db6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
47 deletions
+61
-47
TestServiceImpl.java
...om/example/fuzzControll/service/impl/TestServiceImpl.java
+17
-5
CmdTools.java
...rc/main/java/com/example/fuzzControll/tools/CmdTools.java
+1
-1
LinuxCommandUtil.java
...java/com/example/fuzzControll/tools/LinuxCommandUtil.java
+33
-31
application-dev.yml
fuzzIntegration/src/main/resources/application-dev.yml
+8
-8
result.html
fuzzIntegration/src/main/resources/result.html
+1
-1
result2.html
fuzzIntegration/src/main/resources/result2.html
+1
-1
No files found.
fuzzIntegration/src/main/java/com/example/fuzzControll/service/impl/TestServiceImpl.java
View file @
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
,
pythonCmd
);
cmdTools
.
runProgramCmd
(
aflnetCmd
,
""
);
}
catch
(
JSchException
e
)
{
}
catch
(
JSchException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -86,8 +86,11 @@ public class TestServiceImpl implements TestService {
...
@@ -86,8 +86,11 @@ public class TestServiceImpl implements TestService {
}
}
private
String
dnsCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
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
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/
output_dnsmasq_RLGfuzz"
;
+
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
();
}
}
...
@@ -110,8 +113,11 @@ public class TestServiceImpl implements TestService {
...
@@ -110,8 +113,11 @@ public class TestServiceImpl implements TestService {
}
}
private
String
sipCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
private
String
sipCmd
(
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
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/
output_kamailio_RLGfuzz"
;
+
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 "
...
@@ -132,8 +138,11 @@ public class TestServiceImpl implements TestService {
...
@@ -132,8 +138,11 @@ public class TestServiceImpl implements TestService {
}
}
private
String
ftpCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
private
String
ftpCmd
(
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
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/
output_lightftp_RLGfuzz"
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
()
+
AlgorithmOneCmd
.
ALFNET_OUTPUT_PATH
+
"/LightFTP/Source/Release/
"
+
outputFileName
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
()
+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/lightftp/ftp.dict"
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()+
" -D "
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()+
" -D "
+
algorithmOneCmdParams
.
getWaiting
()+
" -d "
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
+
algorithmOneCmdParams
.
getWaiting
()+
" -d "
+
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
();
...
@@ -152,8 +161,11 @@ public class TestServiceImpl implements TestService {
...
@@ -152,8 +161,11 @@ public class TestServiceImpl implements TestService {
}
}
private
String
rtspCmd
(
AlgorithmOneCmdParams
algorithmOneCmdParams
)
{
private
String
rtspCmd
(
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
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/
output_live555_RLGfuzz"
+
" -z "
+
algorithmOneCmdParams
.
getTrainedModelInputPath
()
+
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 "
+
" -N "
+
algorithmOneCmdParams
.
getNetinfo
()+
" -x /home/lddc/SHENYANLONG/SMGfuzz/tutorials/live555/rtsp.dict "
+
" -P "
+
algorithmOneCmdParams
.
getProtopcol
()+
" -m none "
+
" -D "
+
algorithmOneCmdParams
.
getWaiting
()+
" -d -r 400"
;
+
algorithmOneCmdParams
.
getWaiting
()+
" -d -r 400"
;
String
after
=
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
()
String
after
=
" -q "
+
algorithmOneCmdParams
.
getStateSelectionAlgo
()+
" -s "
+
algorithmOneCmdParams
.
getSeedSelectionAlgo
()
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/tools/CmdTools.java
View file @
4572162c
...
@@ -52,7 +52,7 @@ public class CmdTools {
...
@@ -52,7 +52,7 @@ public class CmdTools {
LinuxCommandUtil
linuxCommandUtil
=
new
LinuxCommandUtil
();
LinuxCommandUtil
linuxCommandUtil
=
new
LinuxCommandUtil
();
linuxCommandUtil
.
connect
(
host
,
port
,
user
,
password
);
linuxCommandUtil
.
connect
(
host
,
port
,
user
,
password
);
linuxCommandUtil
.
execCmd
(
aflnetCmd
);
linuxCommandUtil
.
execCmd
(
aflnetCmd
);
linuxCommandUtil
.
execCmdWithoutResults
(
pythonCmd
);
//
linuxCommandUtil.execCmdWithoutResults(pythonCmd);
}
}
...
...
fuzzIntegration/src/main/java/com/example/fuzzControll/tools/LinuxCommandUtil.java
View file @
4572162c
...
@@ -106,18 +106,18 @@ public class LinuxCommandUtil {
...
@@ -106,18 +106,18 @@ public class LinuxCommandUtil {
public
void
execCmdWithoutResults
(
String
command
)
throws
JSchException
,
IOException
{
public
void
execCmdWithoutResults
(
String
command
)
throws
JSchException
,
IOException
{
InputStream
in
=
channelExec
.
getInputStream
();
InputStream
in
=
channelExec
.
getInputStream
();
InputStream
error
=
channelExec
.
getErrStream
();
InputStream
error
=
channelExec
.
getErrStream
();
new
Thread
(
new
Runnable
()
{
//
new Thread(new Runnable() {
@Override
//
@Override
public
void
run
()
{
//
public void run() {
trainOutPutStream
(
in
);
////
trainOutPutStream(in);
}
//
}
}).
start
();
//
}).start();
new
Thread
(
new
Runnable
()
{
//
new Thread(new Runnable() {
@Override
//
@Override
public
void
run
()
{
//
public void run() {
errorStream
(
error
);
//
errorStream(error);
}
//
}
}).
start
();
//
}).start();
channelExec
.
setCommand
(
command
);
channelExec
.
setCommand
(
command
);
channelExec
.
connect
();
channelExec
.
connect
();
}
}
...
@@ -126,7 +126,8 @@ public class LinuxCommandUtil {
...
@@ -126,7 +126,8 @@ public class LinuxCommandUtil {
Reader
reader
=
new
InputStreamReader
(
in
);
Reader
reader
=
new
InputStreamReader
(
in
);
BufferedReader
bf
=
new
BufferedReader
(
reader
);
BufferedReader
bf
=
new
BufferedReader
(
reader
);
String
line
=
null
;
String
line
=
null
;
List
<
String
>
list
=
null
;
List
<
String
>
list
=
new
ArrayList
<>();
;
try
{
try
{
while
((
line
=
bf
.
readLine
())
!=
null
&&
TestControlTools
.
getIsRunning
())
{
while
((
line
=
bf
.
readLine
())
!=
null
&&
TestControlTools
.
getIsRunning
())
{
System
.
out
.
println
(
line
);
System
.
out
.
println
(
line
);
...
@@ -135,8 +136,9 @@ public class LinuxCommandUtil {
...
@@ -135,8 +136,9 @@ public class LinuxCommandUtil {
}
}
if
(
list
!=
null
)
if
(
list
!=
null
)
list
.
add
(
line
+
"\n"
);
list
.
add
(
line
+
"\n"
);
if
(
line
.
contains
(
"cpu"
)
)
if
(
line
.
contains
(
"cpu"
)
||
line
.
contains
(
"%]"
)
)
{
GlobalParameters
.
webSocket
.
appointSending
(
"fuzzMaster"
,
"web"
,
list
.
toString
());
GlobalParameters
.
webSocket
.
appointSending
(
"fuzzMaster"
,
"web"
,
list
.
toString
());
}
}
}
//结束就关闭
//结束就关闭
if
(!
TestControlTools
.
getIsRunning
())
{
if
(!
TestControlTools
.
getIsRunning
())
{
...
@@ -147,23 +149,23 @@ public class LinuxCommandUtil {
...
@@ -147,23 +149,23 @@ public class LinuxCommandUtil {
}
}
}
}
public
void
trainOutPutStream
(
InputStream
in
)
{
//
public void trainOutPutStream(InputStream in) {
Reader
reader
=
new
InputStreamReader
(
in
);
//
Reader reader = new InputStreamReader(in);
BufferedReader
bf
=
new
BufferedReader
(
reader
);
//
BufferedReader bf = new BufferedReader(reader);
String
line
=
null
;
//
String line = null;
try
{
//
try {
while
((
line
=
bf
.
readLine
())
!=
null
&&
TestControlTools
.
getIsRunning
())
{
//
while ((line = bf.readLine()) != null && TestControlTools.getIsRunning()) {
System
.
out
.
println
(
line
);
//
System.out.println(line);
GlobalParameters
.
webSocket
.
appointSending
(
"fuzzMaster"
,
"webTrainResult"
,
line
);
////
GlobalParameters.webSocket.appointSending("fuzzMaster", "webTrainResult", line);
}
//
}
//结束就关闭
//
//结束就关闭
if
(!
TestControlTools
.
getIsRunning
())
{
//
if (!TestControlTools.getIsRunning()) {
close
();
//
close();
}
//
}
}
catch
(
IOException
e
)
{
//
} catch (IOException e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
}
//
}
public
void
errorStream
(
InputStream
error
)
{
public
void
errorStream
(
InputStream
error
)
{
Reader
reader
=
new
InputStreamReader
(
error
);
Reader
reader
=
new
InputStreamReader
(
error
);
...
...
fuzzIntegration/src/main/resources/application-dev.yml
View file @
4572162c
...
@@ -21,16 +21,16 @@ aflnet:
...
@@ -21,16 +21,16 @@ aflnet:
web
:
web
:
ip
:
192.168.9.177
ip
:
192.168.9.177
#aflnetssh:
# host: 192.168.31.53
# port: 22
# user: lddc
# password: sysulddc
aflnetssh
:
aflnetssh
:
host
:
1
72.17.4.151
host
:
1
92.168.31.53
port
:
22
port
:
22
user
:
root
user
:
lddc
password
:
123456
password
:
sysulddc
#aflnetssh:
# host: 172.17.4.151
# port: 22
# user: root
# password: 123456
#aflnetssh:
#aflnetssh:
# host: 192.168.31.133
# host: 192.168.31.133
# port: 22
# port: 22
...
...
fuzzIntegration/src/main/resources/result.html
View file @
4572162c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
var
ws1
=
null
;
var
ws1
=
null
;
var
ws2
=
null
;
var
ws2
=
null
;
function
myFunction
()
{
function
myFunction
()
{
ws1
=
new
WebSocket
(
"ws://192.168.31.13
3
:8100/websocket/testResult/web"
);
ws1
=
new
WebSocket
(
"ws://192.168.31.13
4
:8100/websocket/testResult/web"
);
ws1
.
onmessage
=
function
(
evt
)
{
ws1
.
onmessage
=
function
(
evt
)
{
console
.
log
(
evt
);
console
.
log
(
evt
);
console
.
log
(
evt
.
data
)
console
.
log
(
evt
.
data
)
...
...
fuzzIntegration/src/main/resources/result2.html
View file @
4572162c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
var
ws1
=
null
;
var
ws1
=
null
;
var
ws2
=
null
;
var
ws2
=
null
;
function
myFunction
()
{
function
myFunction
()
{
ws1
=
new
WebSocket
(
"ws://192.168.31.13
3:8100/websocket/testResult/webTrainResult
"
);
ws1
=
new
WebSocket
(
"ws://192.168.31.13
4:8100/websocket/testResult/web
"
);
ws1
.
onmessage
=
function
(
evt
)
{
ws1
.
onmessage
=
function
(
evt
)
{
console
.
log
(
evt
);
console
.
log
(
evt
);
console
.
log
(
evt
.
data
)
console
.
log
(
evt
.
data
)
...
...
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