Commit 91c7e11d by 钱炳权

24/4/1 漏洞类型、模板生成、变异方法 控制输出转为字符串输出

parent 3e45851d
2024-03-29 11:53:42.791 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 28012 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-03-29 11:53:42.809 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-03-29 11:53:43.531 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-03-29 11:53:43.538 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-03-29 11:53:43.538 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-03-29 11:53:43.687 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-03-29 11:53:43.687 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 821 ms
2024-03-29 11:53:43.903 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-03-29 11:53:43.910 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 1.466 seconds (JVM running for 2.264)
2024-03-29 11:54:41.091 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 32296 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-03-29 11:54:41.094 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-03-29 11:54:41.555 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-03-29 11:54:41.560 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-03-29 11:54:41.561 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-03-29 11:54:41.613 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-03-29 11:54:41.614 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 497 ms
2024-03-29 11:54:41.800 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-03-29 11:54:41.807 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 0.948 seconds (JVM running for 1.483)
2024-03-29 11:54:56.519 [http-nio-8100-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-29 11:54:56.519 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
2024-03-29 11:54:56.520 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
2024-03-29 11:54:56.582 [http-nio-8100-exec-1] WARN o.s.w.s.m.support.DefaultHandlerExceptionResolver - Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot coerce empty String ("") to element of `java.lang.String[]` (but could if coercion was enabled using `CoercionConfig`); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot coerce empty String ("") to element of `java.lang.String[]` (but could if coercion was enabled using `CoercionConfig`)<EOL> at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 3, column: 17] (through reference chain: com.example.fuzzControll.pojo.vo.vulnerabilityTypeEntity["paramJson"])]
2024-03-29 11:55:54.890 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 30344 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-03-29 11:55:54.891 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-03-29 11:55:55.377 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-03-29 11:55:55.383 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-03-29 11:55:55.383 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-03-29 11:55:55.441 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-03-29 11:55:55.441 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 524 ms
2024-03-29 11:55:55.656 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-03-29 11:55:55.663 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 0.984 seconds (JVM running for 1.512)
2024-03-29 11:56:09.890 [http-nio-8100-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-29 11:56:09.890 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
2024-03-29 11:56:09.891 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
2024-03-29 11:56:50.565 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 13664 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-03-29 11:56:50.566 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-03-29 11:56:50.991 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-03-29 11:56:50.996 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-03-29 11:56:50.996 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-03-29 11:56:51.048 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-03-29 11:56:51.048 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 459 ms
2024-03-29 11:56:51.261 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-03-29 11:56:51.266 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 0.906 seconds (JVM running for 1.41)
2024-03-29 11:56:52.566 [http-nio-8100-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-29 11:56:52.566 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
2024-03-29 11:56:52.567 [http-nio-8100-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
2024-04-01 14:39:47.262 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 1688 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-04-01 14:39:47.477 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-04-01 14:39:48.508 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-04-01 14:39:48.515 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-04-01 14:39:48.515 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-04-01 14:39:48.875 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-04-01 14:39:48.876 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1322 ms
2024-04-01 14:39:49.152 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-04-01 14:39:49.182 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 2.67 seconds (JVM running for 4.412)
2024-04-01 14:46:12.499 [main] INFO com.example.fuzzControll.FuzzControlApplication - Starting FuzzControlApplication using Java 11.0.6 on DESKTOP-GDSKRB2 with PID 10652 (D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend\target\classes started by qian in D:\code\company\fuzz-backend\fuzz-backend\fuzzbackend)
2024-04-01 14:46:12.500 [main] INFO com.example.fuzzControll.FuzzControlApplication - The following 1 profile is active: "dev"
2024-04-01 14:46:12.922 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8100 (http)
2024-04-01 14:46:12.926 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-04-01 14:46:12.927 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.68]
2024-04-01 14:46:12.978 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-04-01 14:46:12.978 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 461 ms
2024-04-01 14:46:13.162 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8100 (http) with context path ''
2024-04-01 14:46:13.169 [main] INFO com.example.fuzzControll.FuzzControlApplication - Started FuzzControlApplication in 0.849 seconds (JVM running for 1.322)
......@@ -13,16 +13,16 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/generateMethod")
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("变异方法生成成功!");
}
}
......@@ -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);
}
......@@ -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) {
......
......@@ -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 input) {
private List<String> printMessageToFile(InputStream input, List<String> result) {
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) {
......
......@@ -8,7 +8,7 @@
var ws1 = null;
var ws2 = null;
function myFunction() {
ws1 = new WebSocket("ws://127.0.0.1:8080/websocket/testResult/" + "web"+100);
ws1 = new WebSocket("ws://192.168.37.149:8100/websocket/testResult/" + "web");
ws1.onmessage = function (evt) {
console.log(evt);
var received_msg =JSON.parse(evt.data) ;
......
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