Commit 97a834df by 钱炳权

RECREATE PROJECT

parent abb34784
......@@ -6,10 +6,7 @@ import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.service.SeedFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
......@@ -30,36 +27,43 @@ public class SeedFileController {
* 种子文件查询接口
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
public List<String> list() {
List<String> files = service.getSeedFiles();
return files ;
public AjaxResult list() {
List<String> files = null;
try {
files = service.getSeedFiles();
} catch (CmdException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error();
}
return AjaxResult.success(files);
}
// /**
// * 种子文件删除接口
// */
// @RequestMapping(value = "/delete/{fileName}", method = RequestMethod.GET)
// public AjaxResult delete(@PathVariable("fileName") String fileName) {
// try {
// service.delFile(fileName);
// } catch (CmdException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("种子文件删除失败!");
// }
// return AjaxResult.success("种子文件删除成功!");
// }
//
// /**
// * seeFileUpload
// */
// @RequestMapping(value = "/upload", method = RequestMethod.POST)
// public AjaxResult upload(MultipartFile file) {
// try {
// service.upload(file);
// } catch (FileException | CmdException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("种子文件upload失败!");
// }
// return AjaxResult.success("种子文件upload成功!");
// }
/**
* 种子文件删除接口
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public AjaxResult delete(@RequestParam("fileName") String fileName) {
try {
service.delFile(fileName);
} catch (CmdException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("种子文件删除失败!");
}
return AjaxResult.success("种子文件删除成功!");
}
/**
* seeFileUpload
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public AjaxResult upload(@RequestParam("file") MultipartFile file) {
try {
service.upload(file);
} catch (FileException | CmdException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("上传文件失败!");
}
return AjaxResult.success("上传文件成功!");
}
}
......@@ -81,7 +81,7 @@ public class TestClassController {
* 漏洞类型
*/
@RequestMapping(value = "/vulnerabilityType", method = RequestMethod.POST)
public AjaxResult upload(@RequestBody TestEntity testEntity) {
public AjaxResult vulnerability(@RequestBody TestEntity testEntity) {
try {
Map<String, List<String>> result = vulnerabilityTypeService.generation(testEntity);
return AjaxResult.success(result == null ? "漏洞类型未成功运行!第三方接口可能存在问题。" : result);
......
package com.example.fuzzControll.controller;
import com.example.fuzzControll.exception.AflnetException;
import com.example.fuzzControll.exception.CmdException;
import com.example.fuzzControll.pojo.vo.AjaxResult;
import com.example.fuzzControll.pojo.vo.CmdStartParams;
import com.example.fuzzControll.service.TestService;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
/**
* aflnet测试控制
......@@ -27,20 +29,21 @@ public class TestControler {
* 测试启动
*/
@RequestMapping(value = "/testStart", method = RequestMethod.POST)
public AjaxResult list(@RequestBody final CmdStartParams cmdStartParams) {
public AjaxResult start(@RequestBody final CmdStartParams cmdStartParams) {
//todo 捕获子线程错误
try {
//todo 加个同步锁,执行到特征点就返回数据
new Thread(new Runnable() {
Thread alfnet = new Thread(new Runnable() {
@Override
public void run() {
service.testStart(cmdStartParams);
}
}).start();
} catch (AflnetException e) {
});
alfnet.start();
} catch (AflnetException | CmdException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("测试启动失败!");
}
return AjaxResult.success("测试启动成功!");
return AjaxResult.success("测试已启动!");
}
/**
......
......@@ -3,6 +3,6 @@ package com.example.fuzzControll.exception;
public class FuzzException extends BaseException{
private static final long serialVersionUID = 1L;
public FuzzException(String defaultMessage) {
super(defaultMessage, "fuzz");
super(defaultMessage, "lock");
}
}
package com.example.fuzzControll.exception;
public class LockException extends BaseException{
private static final long serialVersionUID = 1L;
public LockException(String defaultMessage) {
super(defaultMessage, "fuzz");
}
}
......@@ -3,12 +3,14 @@ package com.example.fuzzControll.service;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.ReentrantLock;
public interface SeedFileService {
public List<String> getSeedFiles();
void delFile(String fileName);
void upload(MultipartFile file);
int getSeedFileCount(String msg);
void upload(MultipartFile file) ;
int getSeedFileCount(String msg );
}
......@@ -2,6 +2,8 @@ package com.example.fuzzControll.service;
import com.example.fuzzControll.pojo.vo.CmdStartParams;
import java.util.concurrent.CountDownLatch;
public interface TestService {
void testStart(CmdStartParams cmdStartParams);
......
......@@ -4,16 +4,21 @@ import com.example.fuzzControll.conf.SeedProperties;
import com.example.fuzzControll.constents.CmdConstent;
import com.example.fuzzControll.exception.CmdException;
import com.example.fuzzControll.exception.FileException;
import com.example.fuzzControll.exception.LockException;
import com.example.fuzzControll.service.SeedFileService;
import com.example.fuzzControll.tools.CmdTools;
import com.example.fuzzControll.tools.FileTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.ReentrantLock;
@Slf4j
@Service
public class SeedFileServiceImpl implements SeedFileService {
CmdTools cmdTools = new CmdTools();
......@@ -31,9 +36,9 @@ public class SeedFileServiceImpl implements SeedFileService {
public void delFile(String fileName) throws CmdException {
int fileCountBefore = 0;
int fileCountAfter = 0;
fileCountBefore = getSeedFileCount("delFile before.");
cmdTools.runCmd(CmdConstent.DELETE_FILE + properties.getSeedPath() + "/" + fileName, "delFile");
fileCountAfter = getSeedFileCount("delFile after.");
fileCountBefore = getSeedFileCount("delFile before.");
cmdTools.runCmd(CmdConstent.DELETE_FILE + properties.getSeedPath() + "/" + fileName, "delFile");
fileCountAfter = getSeedFileCount("delFile after.");
if (fileCountAfter == fileCountBefore) {
throw new CmdException("Delete unsuccess ! The file has not changed .Attempt to change permissions or there is no filr to be deleted.");
}
......@@ -48,7 +53,7 @@ public class SeedFileServiceImpl implements SeedFileService {
fileTools.load(file);
fileCountAfter = getSeedFileCount("upload after.");
if (fileCountAfter == fileCountBefore) {
throw new FileException("upload file error !The file failed to be submitted.Attempt to change permissions.");
throw new FileException("upload file error !The file failed to be submitted.Attempt to change permissions.Or thr file has been committed.");
}
}
......
......@@ -12,6 +12,8 @@ import com.example.fuzzControll.tools.TestControlTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.concurrent.CountDownLatch;
@Service("testService")
@Slf4j
public class TestServiceImpl implements TestService {
......@@ -21,7 +23,7 @@ public class TestServiceImpl implements TestService {
//todo 不同服务不同端口
@Override
public void testStart(CmdStartParams cmdStartParams) throws AflnetException {
public void testStart(CmdStartParams cmdStartParams) throws AflnetException,CmdException {
TestControlTools.setIsRunning(true);
String cmd = cmdTools.parse(cmdStartParams);
String finalCmd = CmdConstent.RUN_AFLNET + cmd + kittyProperties.getAflnetPath()+"live555/testProgs/testOnDemandRTSPServer 8554";
......
......@@ -13,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.ReentrantLock;
//todo need modify
......@@ -22,6 +24,7 @@ public class CmdTools {
WebSocket socket = (WebSocket) SpringContextUtil.getBean("WebSocket");
Boolean show = true;
/**
* 运行不需要后台运行cmd
*/
......@@ -39,7 +42,6 @@ public class CmdTools {
return result;
}
//todo 不同协议种子路径也不同
/**
......
spring:
application:
name: fuzz-backend
name: fuzz-backend-integration
profiles:
active: dev #默认为开发环境
......
__ ___ _ __ _
/ _|_ _ ________ / __\ __ _ ___| | __ /__\ __ __| |
| |_| | | |_ /_ //__\/// _` |/ __| |/ //_\| '_ \ / _` |
| _| |_| |/ / / // \/ \ (_| | (__| <//__| | | | (_| |
|_| \__,_/___/___\_____/\__,_|\___|_|\_\__/|_| |_|\__,_|
\ No newline at end of file
,---, ___ ___
.--., ,`--.' | ,--.'|_ ,--.'|_ ,--,
,--.' \ ,--, ,----, ,----,| : : ,---, | | :,' __ ,-. | | :,' ,--.'| ,---. ,---,
| | /\/ ,'_ /| .' .`| .' .`|: | ' ,-+-. / | : : ' : ,----._,.,' ,'/ /| : : ' : | |, ' ,'\ ,-+-. / |
: : : .--. | | : .' .' .' .' .' .'| : | ,--.'|' |.;__,' / ,---. / / ' /' | |' | ,--.--. .;__,' / `--'_ / / | ,--.'|' |
: | |-,,'_ /| : . | ,---, ' ./ ,---, ' ./ ' ' ;| | ,"' || | | / \ | : || | ,'/ \ | | | ,' ,'| . ; ,. :| | ,"' |
| : :/|| ' | | . . ; | .' / ; | .' / | | || | / | |:__,'| : / / || | .\ .' : / .--. .-. |:__,'| : ' | | ' | |: :| | / | |
| | .'| | ' | | | `---' / ;--,`---' / ;--,' : ;| | | | | ' : |__ . ' / |. ; '; || | ' \__\/: . . ' : |__ | | : ' | .; :| | | | |
' : ' : | : ; ; | / / / .`| / / / .`|| | '| | | |/ | | '.'|' ; /|' . . |; : | ," .--.; | | | '.'|' : |_| : || | | |/
| | | ' : `--' \./__; .' ./__; .' ' : || | |--' ; : ;' | / | `---`-'| || , ; / / ,. | ; : ;| | '.'\ \ / | | |--'
| : \ : , .-./; | .' ; | .' ; |.' | |/ | , / | : | .'__/\_: | ---' ; : .' \ | , / ; : ;`----' | |/
| |,' `--`----' `---' `---' '---' '---' ---`-' \ \ / | : : | , .-./ ---`-' | , / '---'
`--' `----' \ \ / `--`---' ---`-'
`--`-'
\ No newline at end of file
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.exception.CmdException;
import com.example.fuzzbackendmaster.exception.FileException;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.service.SeedFileApi;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -24,47 +22,29 @@ import java.util.List;
public class SeedFileController {
@Autowired
SeedFileApi seedFileApi;
FuzzIntegrationFileApi fuzzIntegrationFileApi;
/**
* 种子文件查询接口
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
public AjaxResult list() {
List<String> files = null;
try {
files = seedFileApi.list();
} catch (CmdException e) {
log.error(e.getDefaultMessage());
return AjaxResult.error("种子文件获取失败!");
}
return AjaxResult.success(files);
return fuzzIntegrationFileApi.list();
}
// /**
// * 种子文件删除接口
// */
// @RequestMapping(value = "/delete/{fileName}", method = RequestMethod.GET)
// public AjaxResult delete(@PathVariable("fileName")String fileName) {
// try {
// seedFileApi.delFile(fileName);
// } catch (CmdException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("种子文件删除失败!");
// }
// return AjaxResult.success("种子文件删除成功!");
// }
// /**
// * seeFileUpload
// */
// @RequestMapping(value = "/upload", method = RequestMethod.POST)
// public AjaxResult upload(MultipartFile file) {
// try {
// seedFileApi.upload(file);
// } catch (FileException | CmdException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("种子文件upload失败!");
// }
// return AjaxResult.success("种子文件upload成功!");
// }
/**
* 种子文件删除接口
*/
@RequestMapping(value = "/delete/{fileName}", method = RequestMethod.GET)
public AjaxResult delete(@PathVariable("fileName") String fileName) {
return fuzzIntegrationFileApi.delFile(fileName);
}
/**
* seeFileUpload
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public AjaxResult upload(MultipartFile file) {
return fuzzIntegrationFileApi.upload(file);
}
}
//package com.example.fuzzbackendmaster.controller;
//
//import com.example.fuzzControll.exception.CmdException;
//import com.example.fuzzControll.exception.FuzzException;
//import com.example.fuzzControll.pojo.vo.AjaxResult;
//import com.example.fuzzControll.pojo.vo.TestEntity;
//import com.example.fuzzControll.service.GenerateMethodService;
//import com.example.fuzzControll.service.MutationService;
//import com.example.fuzzControll.service.ProtocolTemplateService;
//import com.example.fuzzControll.service.VulnerabilityTypeService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * 不同类型的测试方法
// */
//@Slf4j
//@RestController
//@RequestMapping("/testClass")
//public class TestClassController {
// @Autowired
// GenerateMethodService generateMethodService;
// @Autowired
// MutationService mutationService;
// @Autowired
// ProtocolTemplateService protocolTemplateService;
// @Autowired
// VulnerabilityTypeService vulnerabilityTypeService;
//
// /**
// * 模板
// */
// @RequestMapping(value = "/protocolTemplate", method = RequestMethod.POST)
// public AjaxResult protocolTemplate(@RequestBody TestEntity testEntity) {
// try {
// Map<String, List<String>> result = protocolTemplateService.generation(testEntity);
// return AjaxResult.success(result == null ? "模板文件生成未成功运行!第三方接口可能存在问题。" : result);
// } catch (CmdException | FuzzException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("模板生成失败!系统存在问题。");
// }
// }
//
// /**
// * 生成方法
// */
// @RequestMapping(value = "/generate", method = RequestMethod.POST)
// public AjaxResult generate(@RequestBody TestEntity testEntity) {
// try {
// Map<String, List<String>> result = generateMethodService.generation(testEntity);
// return AjaxResult.success(result == null ? "生成方法未成功运行!第三方接口可能存在问题。" : result);
// } catch (CmdException | FuzzException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("生成方法使用失败!系统存在问题。");
// }
// }
//
// /**
// * 变异方法
// */
// @RequestMapping(value = "/mutation", method = RequestMethod.POST)
// public AjaxResult mutation(@RequestBody TestEntity testEntity) {
// try {
// Map<String, List<String>> result = mutationService.generation(testEntity);
// return AjaxResult.success(result == null ? "mutationTest未成功运行!第三方接口可能存在问题。" : result);
// } catch (CmdException | FuzzException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("mutationTest失败!系统存在问题。");
// }
// }
//
// /**
// * 漏洞类型
// */
// @RequestMapping(value = "/vulnerabilityType", method = RequestMethod.POST)
// public AjaxResult upload(@RequestBody TestEntity testEntity) {
// try {
// Map<String, List<String>> result = vulnerabilityTypeService.generation(testEntity);
// return AjaxResult.success(result == null ? "漏洞类型未成功运行!第三方接口可能存在问题。" : result);
// } catch (CmdException | FuzzException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("漏洞类型测试失败!系统存在问题。");
// }
// }
//}
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.exception.CmdException;
import com.example.fuzzbackendmaster.exception.FuzzException;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.pojo.vo.TestEntity;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 不同类型的测试方法
*/
@Slf4j
@RestController
@RequestMapping("/testClass")
public class TestClassController {
@Autowired
FuzzIntegrationFileApi fuzzIntegrationFileApi;
/**
* 模板
*/
@RequestMapping(value = "/protocolTemplate", method = RequestMethod.POST)
public AjaxResult protocolTemplate(@RequestBody TestEntity testEntity) {
return fuzzIntegrationFileApi.protocolTemplate(testEntity);
}
/**
* 生成方法
*/
@RequestMapping(value = "/generate", method = RequestMethod.POST)
public AjaxResult generate(@RequestBody TestEntity testEntity) {
return fuzzIntegrationFileApi.generate(testEntity);
}
/**
* 变异方法
*/
@RequestMapping(value = "/mutation", method = RequestMethod.POST)
public AjaxResult mutation(@RequestBody TestEntity testEntity) {
return fuzzIntegrationFileApi.mutation(testEntity);
}
/**
* 漏洞类型
*/
@RequestMapping(value = "/vulnerabilityType", method = RequestMethod.POST)
public AjaxResult upload(@RequestBody TestEntity testEntity) {
return fuzzIntegrationFileApi.vulnerability(testEntity);
}
}
//package com.example.fuzzbackendmaster.controller;
//
//import com.example.fuzzControll.exception.AflnetException;
//import com.example.fuzzControll.pojo.vo.AjaxResult;
//import com.example.fuzzControll.pojo.vo.CmdStartParams;
//import com.example.fuzzControll.service.TestService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * aflnet测试控制
// */
//@Slf4j
//@RestController
//@RequestMapping("/test")
//public class TestControler {
// @Autowired
// TestService service;
//
// /**
// * 测试启动
// */
// @RequestMapping(value = "/testStart", method = RequestMethod.POST)
// public AjaxResult list(@RequestBody final CmdStartParams cmdStartParams) {
// try {
// //todo 加个同步锁,执行到特征点就返回数据
// new Thread(new Runnable() {
// @Override
// public void run() {
// service.testStart(cmdStartParams);
// }
// }).start();
// } catch (AflnetException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("测试启动失败!");
// }
// return AjaxResult.success("测试启动成功!");
// }
//
// /**
// * 测试停止
// */
// @RequestMapping(value = "/testStop", method = RequestMethod.GET)
// public AjaxResult testStop() {
// try {
// service.testStop();
// } catch (AflnetException e) {
// log.error(e.getDefaultMessage());
// return AjaxResult.error("测试停止失败!");
// }
// return AjaxResult.success("测试停止成功!");
// }
//}
//
package com.example.fuzzbackendmaster.controller;
import com.example.fuzzbackendmaster.exception.AflnetException;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.pojo.vo.CmdStartParams;
import com.example.fuzzbackendmaster.service.FuzzIntegrationFileApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* aflnet测试控制
*/
@Slf4j
@RestController
@RequestMapping("/test")
public class TestControler {
@Autowired
FuzzIntegrationFileApi fuzzIntegrationFileApi;
/**
* 测试启动
*/
@RequestMapping(value = "/testStart", method = RequestMethod.POST)
public AjaxResult list(@RequestBody final CmdStartParams cmdStartParams) {
return fuzzIntegrationFileApi.testStart(cmdStartParams);
}
/**
* 测试停止
*/
@RequestMapping(value = "/testStop", method = RequestMethod.GET)
public AjaxResult testStop() {
return fuzzIntegrationFileApi.testStop();
}
}
\ No newline at end of file
package com.example.fuzzbackendmaster.pojo.vo;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class CmdStartParams {
String netinfo; //netInfo
String protopcol; //protocol
int waiting; //usec
String nsname;//netnsname
Boolean kill;
Boolean awareMode;
Boolean regionMutationOperators;
Boolean falseNegativeMode;
String script;//script
int stateSelectionAlgo;
int seedSelectionAlgo;
}
package com.example.fuzzbackendmaster.pojo.vo;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class TestEntity {
String testClassName;
String[] paramJson;
}
package com.example.fuzzbackendmaster.service;
import com.example.fuzzbackendmaster.pojo.vo.AjaxResult;
import com.example.fuzzbackendmaster.pojo.vo.CmdStartParams;
import com.example.fuzzbackendmaster.pojo.vo.TestEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Component
@FeignClient(value = "fuzz-backend-integration")
public interface FuzzIntegrationFileApi {
/**
* seedFlole
*
*/
@RequestMapping(value = "/seedFile/list", method = RequestMethod.GET)
AjaxResult list();
@RequestMapping(value = "/seedFile/upload", method = RequestMethod.GET, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
AjaxResult upload(@RequestPart("file") MultipartFile file);
@RequestMapping(value = "/seedFile/delete", method = RequestMethod.GET, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
AjaxResult delFile(@RequestPart("fileName") String fileName);
/**
* testclass
*
*/
@RequestMapping(value = "/testClass/protocolTemplate", method = RequestMethod.POST)
AjaxResult protocolTemplate(@RequestBody TestEntity testEntity);
@RequestMapping(value = "/testClass/generate", method = RequestMethod.POST)
AjaxResult generate(@RequestBody TestEntity testEntity);
@RequestMapping(value = "/testClass/mutation", method = RequestMethod.POST)
AjaxResult mutation(@RequestBody TestEntity testEntity);
@RequestMapping(value = "/testClass/vulnerabilityType", method = RequestMethod.POST)
AjaxResult vulnerability(@RequestBody TestEntity testEntity);
/**
*
* Aflnet
*/
@RequestMapping(value = "/test/testStop", method = RequestMethod.GET)
AjaxResult testStop();
@RequestMapping(value = "/test/testStart", method = RequestMethod.POST)
AjaxResult testStart(@RequestBody final CmdStartParams cmdStartParams);
}
//package com.example.fuzzbackendmaster.service;
//
//import org.springframework.cloud.openfeign.FeignClient;
//import org.springframework.stereotype.Component;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//
//@Component
//@FeignClient(value = "fuzz-backend")
//public interface KittyServerMessageApi {
// @PostMapping("/kittyServer/stats")
// public CommonResult addPayment(@RequestBody Payment payment);
//
// @GetMapping("/kittyServer/templateInfo")
// public CommonResult findPaymentById(@PathVariable("id")Long id);
//
// @GetMapping("/kittyServer/stages")
// public CommonResult findPaymentList();
// @GetMapping("/kittyServer/report")
// public CommonResult findPaymentList();
//}
package com.example.fuzzbackendmaster.service;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@Component
@FeignClient(value = "fuzz-backend")
public interface SeedFileApi {
@PostMapping("/seedFile/list")
public List<String> list( );
// @GetMapping("/seedFile/delete/{fileName}")
// public CommonResult findPaymentById(@PathVariable("id") Long id);
//
// @GetMapping("/seedFile/upload")
// public CommonResult findPaymentList();
}
package com.example.fuzzbackendmaster.service;
public interface TestApi {
}
package com.example.fuzzbackendmaster.service;
public interface TestClassApi {
}
__ ___ _ __ _
/ _|_ _ ________ / __\ __ _ ___| | __ /__\ __ __| |
| |_| | | |_ /_ //__\/// _` |/ __| |/ //_\| '_ \ / _` |
| _| |_| |/ / / // \/ \ (_| | (__| <//__| | | | (_| |
|_| \__,_/___/___\_____/\__,_|\___|_|\_\__/|_| |_|\__,_|
\ No newline at end of file
,-. ____ ___
.--., ,---, ,--/ /| ,---, ,' , `. ,--.'|_
,--.' \ ,--, ,----, ,----,,---.'| ,--. :/ | ,---, ,---.'| ,-+-,.' _ | | | :,' __ ,-.
| | /\/ ,'_ /| .' .`| .' .`|| | : : : ' / ,-+-. / | | | : ,-+-. ; , || .--.--. : : ' : ,' ,'/ /|
: : : .--. | | : .' .' .' .' .' .': : : ,--.--. ,---. | ' / ,---. ,--.'|' | | | | ,--.'|' | || ,--.--. / / '.;__,' / ,---. ' | |' |
: | |-,,'_ /| : . | ,---, ' ./ ,---, ' ./ : |,-. / \ / \ ' | : / \| | ,"' | ,--.__| || | ,', | |,/ \ | : /`./| | | / \ | | ,'
| : :/|| ' | | . . ; | .' / ; | .' / | : ' | .--. .-. | / / ' | | \ / / | | / | | / ,' || | / | |--'.--. .-. | | : ;_ :__,'| : / / |' : /
| | .'| | ' | | | `---' / ;--,`---' / ;--,| | / : \__\/: . .. ' / ' : |. \ . ' / | | | | |. ' / || : | | , \__\/: . . \ \ `. ' : |__ . ' / || | '
' : ' : | : ; ; | / / / .`| / / / .`|' : |: | ," .--.; |' ; :__ | | ' \ \' ; /| | | |/ ' ; |: || : | |/ ," .--.; | `----. \| | '.'|' ; /|; : |
| | | ' : `--' \./__; .' ./__; .' | | '/ : / / ,. |' | '.'|' : |--' ' | / | | |--' | | '/ '| | |`-' / / ,. | / /`--' /; : ;' | / || , ;
| : \ : , .-./; | .' ; | .' | : |; : .' \ : :; |,' | : | |/ | : :|| ;/ ; : .' \'--'. / | , / | : | ---'
| |,' `--`----' `---' `---' / \ / | , .-./\ \ / '--' \ \ /'---' \ \ / '---' | , .-./ `--'---' ---`-' \ \ /
`--' `-'----' `--`---' `----' `----' `----' `--`---' `----'
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