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
91c7e11d
Commit
91c7e11d
authored
Apr 01, 2024
by
钱炳权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
24/4/1 漏洞类型、模板生成、变异方法 控制输出转为字符串输出
parent
3e45851d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
11 deletions
+18
-11
spring.log
fuzzbackend/log/spring.log
+0
-0
generateMethodController.java
...ple/fuzzControll/controller/generateMethodController.java
+2
-2
generateMethodService.java
...m/example/fuzzControll/service/generateMethodService.java
+3
-1
generateMethodServiceImpl.java
.../fuzzControll/service/impl/generateMethodServiceImpl.java
+4
-2
cmdTools.java
...rc/main/java/com/example/fuzzControll/tools/cmdTools.java
+8
-5
result.html
fuzzbackend/src/main/resources/result.html
+1
-1
No files found.
fuzzbackend/log/spring.log
View file @
91c7e11d
This diff is collapsed.
Click to expand it.
fuzzbackend/src/main/java/com/example/fuzzControll/controller/generateMethodController.java
View file @
91c7e11d
...
...
@@ -16,13 +16,13 @@ public class generateMethodController {
@Autowired
generateMethodService
service
;
@RequestMapping
(
value
=
"/generate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
upload
(
@RequestBody
generateMethodEntity
generateMethodEntity
)
{
try
{
service
.
generation
(
generateMethodEntity
);
return
AjaxResult
.
success
(
service
.
generation
(
generateMethodEntity
)
);
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
"变异方法使用失败!"
);
}
return
AjaxResult
.
success
(
"变异方法生成成功!"
);
}
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/generateMethodService.java
View file @
91c7e11d
...
...
@@ -3,6 +3,8 @@ package com.example.fuzzControll.service;
import
com.example.fuzzControll.pojo.vo.generateMethodEntity
;
import
com.example.fuzzControll.pojo.vo.protocolGenerationEntity
;
import
java.util.List
;
public
interface
generateMethodService
{
void
generation
(
generateMethodEntity
generateMethodEntity
);
List
<
String
>
generation
(
generateMethodEntity
generateMethodEntity
);
}
fuzzbackend/src/main/java/com/example/fuzzControll/service/impl/generateMethodServiceImpl.java
View file @
91c7e11d
...
...
@@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Slf4j
public
class
generateMethodServiceImpl
implements
generateMethodService
{
...
...
@@ -17,9 +19,9 @@ public class generateMethodServiceImpl implements generateMethodService {
kittyProperties
kitty
;
@Override
public
void
generation
(
generateMethodEntity
generateMethodEntity
)
{
public
List
<
String
>
generation
(
generateMethodEntity
generateMethodEntity
)
{
String
cmd
=
parseParameters
(
generateMethodEntity
);
cmdTools
.
runProgramCmdAndResultTofile
(
cmd
);
return
cmdTools
.
runProgramCmdAndResultTofile
(
cmd
);
}
public
String
parseParameters
(
generateMethodEntity
generateMethodEntity
)
{
...
...
fuzzbackend/src/main/java/com/example/fuzzControll/tools/cmdTools.java
View file @
91c7e11d
...
...
@@ -54,18 +54,20 @@ public class cmdTools {
* 运行需要后台运行cmd
* 将数据存入文件中
*/
public
void
runProgramCmdAndResultTofile
(
String
cmd
)
{
public
List
<
String
>
runProgramCmdAndResultTofile
(
String
cmd
)
{
List
<
String
>
result
=
new
ArrayList
<>();
try
{
Process
process
=
Runtime
.
getRuntime
().
exec
(
cmd
);
printMessageToFile
(
process
.
getInputStream
());
printMessageToFile
(
process
.
getErrorStream
());
printMessageToFile
(
process
.
getInputStream
()
,
result
);
printMessageToFile
(
process
.
getErrorStream
()
,
new
ArrayList
<
String
>()
);
process
.
waitFor
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
result
;
}
private
void
printMessageToFile
(
InputStream
inpu
t
)
{
private
List
<
String
>
printMessageToFile
(
InputStream
input
,
List
<
String
>
resul
t
)
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -74,7 +76,7 @@ public class cmdTools {
String
line
=
null
;
try
{
while
((
line
=
bf
.
readLine
())
!=
null
)
{
System
.
out
.
println
(
line
);
result
.
add
(
line
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -82,6 +84,7 @@ public class cmdTools {
}
}).
start
();
return
result
;
}
private
List
<
String
>
printMessage
(
final
InputStream
input
,
List
<
String
>
result
)
{
...
...
fuzzbackend/src/main/resources/result.html
View file @
91c7e11d
...
...
@@ -8,7 +8,7 @@
var
ws1
=
null
;
var
ws2
=
null
;
function
myFunction
()
{
ws1
=
new
WebSocket
(
"ws://1
27.0.0.1:8080/websocket/testResult/"
+
"web"
+
100
);
ws1
=
new
WebSocket
(
"ws://1
92.168.37.149:8100/websocket/testResult/"
+
"web"
);
ws1
.
onmessage
=
function
(
evt
)
{
console
.
log
(
evt
);
var
received_msg
=
JSON
.
parse
(
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