+ * Created by vaycore on 2024-05-07. + */ +public class MessageEditorController implements IMessageEditorController { + + private IHttpService service; + private byte[] request; + private byte[] response; + + @Override + public IHttpService getHttpService() { + return this.service; + } + + @Override + public byte[] getRequest() { + if (this.request == null || this.request.length == 0) { + return new byte[0]; + } + return this.request; + } + + @Override + public byte[] getResponse() { + if (this.response == null || this.response.length == 0) { + return new byte[0]; + } + return this.response; + } + + public void setHttpService(IHttpService service) { + this.service = service; + } + + public void setRequest(byte[] request) { + this.request = request; + } + + public void setResponse(byte[] response) { + this.response = response; + } +} diff --git a/src/main/java/burp/hae/montoya/MontoyaApiImpl.java b/src/main/java/burp/hae/montoya/MontoyaApiImpl.java new file mode 100644 index 0000000..3f8574b --- /dev/null +++ b/src/main/java/burp/hae/montoya/MontoyaApiImpl.java @@ -0,0 +1,142 @@ +package burp.hae.montoya; + +import burp.IBurpExtenderCallbacks; +import burp.api.montoya.MontoyaApi; +import burp.api.montoya.burpsuite.BurpSuite; +import burp.api.montoya.collaborator.Collaborator; +import burp.api.montoya.comparer.Comparer; +import burp.api.montoya.decoder.Decoder; +import burp.api.montoya.extension.Extension; +import burp.api.montoya.http.Http; +import burp.api.montoya.intruder.Intruder; +import burp.api.montoya.logging.Logging; +import burp.api.montoya.organizer.Organizer; +import burp.api.montoya.persistence.Persistence; +import burp.api.montoya.proxy.Proxy; +import burp.api.montoya.repeater.Repeater; +import burp.api.montoya.scanner.Scanner; +import burp.api.montoya.scope.Scope; +import burp.api.montoya.sitemap.SiteMap; +import burp.api.montoya.ui.UserInterface; +import burp.api.montoya.utilities.Utilities; +import burp.api.montoya.websocket.WebSockets; +import burp.hae.montoya.extension.ExtensionImpl; +import burp.hae.montoya.http.HttpImpl; +import burp.hae.montoya.logging.LoggingImpl; +import burp.hae.montoya.proxy.ProxyImpl; +import burp.hae.montoya.ui.UserInterfaceImpl; +import burp.hae.montoya.utilities.UtilitiesImpl; + +/** + * MontoyaAPI 接口实现 + *
+ * Created by vaycore on 2024-05-06. + */ +public class MontoyaApiImpl implements MontoyaApi { + + private final ExtensionImpl extension; + private final Http http; + private final Logging logging; + private final Proxy proxy; + private final UserInterface userInterface; + private final UtilitiesImpl utilities; + + public MontoyaApiImpl(IBurpExtenderCallbacks callbacks) { + this.extension = new ExtensionImpl(callbacks); + this.http = new HttpImpl(callbacks); + this.logging = new LoggingImpl(callbacks); + this.proxy = new ProxyImpl(callbacks); + this.userInterface = new UserInterfaceImpl(callbacks); + this.utilities = new UtilitiesImpl(callbacks); + } + + @Override + public BurpSuite burpSuite() { + return null; + } + + @Override + public Collaborator collaborator() { + return null; + } + + @Override + public Comparer comparer() { + return null; + } + + @Override + public Decoder decoder() { + return null; + } + + @Override + public Extension extension() { + return this.extension; + } + + @Override + public Http http() { + return http; + } + + @Override + public Intruder intruder() { + return null; + } + + @Override + public Logging logging() { + return this.logging; + } + + @Override + public Organizer organizer() { + return null; + } + + @Override + public Persistence persistence() { + return null; + } + + @Override + public Proxy proxy() { + return this.proxy; + } + + @Override + public Repeater repeater() { + return null; + } + + @Override + public Scanner scanner() { + return null; + } + + @Override + public Scope scope() { + return null; + } + + @Override + public SiteMap siteMap() { + return null; + } + + @Override + public UserInterface userInterface() { + return userInterface; + } + + @Override + public Utilities utilities() { + return this.utilities; + } + + @Override + public WebSockets websockets() { + return null; + } +} diff --git a/src/main/java/burp/hae/montoya/extension/ExtensionImpl.java b/src/main/java/burp/hae/montoya/extension/ExtensionImpl.java new file mode 100644 index 0000000..6e367a0 --- /dev/null +++ b/src/main/java/burp/hae/montoya/extension/ExtensionImpl.java @@ -0,0 +1,44 @@ +package burp.hae.montoya.extension; + +import burp.IBurpExtenderCallbacks; +import burp.api.montoya.core.Registration; +import burp.api.montoya.extension.Extension; +import burp.api.montoya.extension.ExtensionUnloadingHandler; + +/** + *
+ * Created by vaycore on 2024-05-06. + */ +public class ExtensionImpl implements Extension { + + private final IBurpExtenderCallbacks callbacks; + + public ExtensionImpl(IBurpExtenderCallbacks callbacks) { + this.callbacks = callbacks; + } + + @Override + public void setName(String extensionName) { + this.callbacks.setExtensionName(extensionName); + } + + @Override + public String filename() { + return this.callbacks.getExtensionFilename(); + } + + @Override + public boolean isBapp() { + return this.callbacks.isExtensionBapp(); + } + + @Override + public void unload() { + this.callbacks.unloadExtension(); + } + + @Override + public Registration registerUnloadingHandler(ExtensionUnloadingHandler extensionUnloadingHandler) { + return null; + } +} diff --git a/src/main/java/burp/hae/montoya/http/HttpImpl.java b/src/main/java/burp/hae/montoya/http/HttpImpl.java new file mode 100644 index 0000000..b316aa3 --- /dev/null +++ b/src/main/java/burp/hae/montoya/http/HttpImpl.java @@ -0,0 +1,129 @@ +package burp.hae.montoya.http; + +import burp.IBurpExtenderCallbacks; +import burp.IExtensionHelpers; +import burp.IHttpRequestResponse; +import burp.IHttpService; +import burp.api.montoya.core.ByteArray; +import burp.api.montoya.core.Registration; +import burp.api.montoya.http.Http; +import burp.api.montoya.http.HttpMode; +import burp.api.montoya.http.HttpService; +import burp.api.montoya.http.RequestOptions; +import burp.api.montoya.http.handler.HttpHandler; +import burp.api.montoya.http.message.HttpRequestResponse; +import burp.api.montoya.http.message.requests.HttpRequest; +import burp.api.montoya.http.message.responses.HttpResponse; +import burp.api.montoya.http.message.responses.analysis.ResponseKeywordsAnalyzer; +import burp.api.montoya.http.message.responses.analysis.ResponseVariationsAnalyzer; +import burp.api.montoya.http.sessions.CookieJar; +import burp.api.montoya.http.sessions.SessionHandlingAction; + +import java.util.List; + +/** + *
+ * Created by vaycore on 2024-05-06.
+ */
+public class HttpImpl implements Http {
+
+ private final IBurpExtenderCallbacks callbacks;
+ private final IExtensionHelpers helpers;
+ private HttpHandler httpHandler;
+
+ public HttpImpl(IBurpExtenderCallbacks callbacks) {
+ this.callbacks = callbacks;
+ this.helpers = callbacks.getHelpers();
+ }
+
+ @Override
+ public Registration registerHttpHandler(HttpHandler handler) {
+ this.httpHandler = handler;
+ return new Registration() {
+ @Override
+ public boolean isRegistered() {
+ return HttpImpl.this.httpHandler != null;
+ }
+
+ @Override
+ public void deregister() {
+ HttpImpl.this.httpHandler = null;
+ }
+ };
+ }
+
+ public HttpHandler httpHandler() {
+ return httpHandler;
+ }
+
+ @Override
+ public Registration registerSessionHandlingAction(SessionHandlingAction sessionHandlingAction) {
+ return null;
+ }
+
+ @Override
+ public HttpRequestResponse sendRequest(HttpRequest request) {
+ HttpService httpService = request.httpService();
+ IHttpService service = this.helpers.buildHttpService(httpService.host(), httpService.port(),
+ httpService.secure());
+ IHttpRequestResponse httpReqResp = this.callbacks.makeHttpRequest(service, request.toByteArray().getBytes());
+ return buildHttpRequestResponse(httpReqResp);
+ }
+
+ @Override
+ public HttpRequestResponse sendRequest(HttpRequest request, HttpMode httpMode) {
+ return null;
+ }
+
+ @Override
+ public HttpRequestResponse sendRequest(HttpRequest request, HttpMode httpMode, String connectionId) {
+ return null;
+ }
+
+ @Override
+ public HttpRequestResponse sendRequest(HttpRequest request, RequestOptions requestOptions) {
+ return null;
+ }
+
+ @Override
+ public List
+ * Created by vaycore on 2024-05-07.
+ */
+public class HttpRequestToBeSentImpl implements HttpRequestToBeSent {
+
+ private final HttpRequest request;
+ private final Annotations annotations;
+ private final ToolType toolType;
+
+ public HttpRequestToBeSentImpl(HttpRequest request, Annotations annotations, ToolType toolType) {
+ this.request = request;
+ this.annotations = annotations;
+ this.toolType = toolType;
+ }
+
+ @Override
+ public int messageId() {
+ return 0;
+ }
+
+ @Override
+ public Annotations annotations() {
+ return this.annotations;
+ }
+
+ @Override
+ public ToolSource toolSource() {
+ return new ToolSource() {
+ @Override
+ public ToolType toolType() {
+ return HttpRequestToBeSentImpl.this.toolType;
+ }
+
+ @Override
+ public boolean isFromTool(ToolType... toolType) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public boolean isInScope() {
+ return this.request.isInScope();
+ }
+
+ @Override
+ public HttpService httpService() {
+ return this.request.httpService();
+ }
+
+ @Override
+ public String url() {
+ return this.request.url();
+ }
+
+ @Override
+ public String method() {
+ return this.request.method();
+ }
+
+ @Override
+ public String path() {
+ return this.request.path();
+ }
+
+ @Override
+ public String query() {
+ return this.request.query();
+ }
+
+ @Override
+ public String pathWithoutQuery() {
+ return this.request.pathWithoutQuery();
+ }
+
+ @Override
+ public String fileExtension() {
+ return this.request.fileExtension();
+ }
+
+ @Override
+ public String httpVersion() {
+ return this.request.httpVersion();
+ }
+
+ @Override
+ public List
+ * Created by vaycore on 2024-05-07.
+ */
+public class HttpResponseReceivedImpl implements HttpResponseReceived {
+
+ private final HttpRequest request;
+ private final HttpResponse response;
+ private final Annotations annotations;
+ private final ToolType toolType;
+
+ public HttpResponseReceivedImpl(HttpRequest request, HttpResponse response,
+ Annotations annotations, ToolType toolType) {
+ this.request = request;
+ this.response = response;
+ this.annotations = annotations;
+ this.toolType = toolType;
+ }
+
+ @Override
+ public int messageId() {
+ return 0;
+ }
+
+ @Override
+ public HttpRequest initiatingRequest() {
+ return this.request;
+ }
+
+ @Override
+ public Annotations annotations() {
+ return this.annotations;
+ }
+
+ @Override
+ public ToolSource toolSource() {
+ return new ToolSource() {
+ @Override
+ public ToolType toolType() {
+ return HttpResponseReceivedImpl.this.toolType;
+ }
+
+ @Override
+ public boolean isFromTool(ToolType... toolType) {
+ return false;
+ }
+ };
+ }
+
+ @Override
+ public short statusCode() {
+ return this.response.statusCode();
+ }
+
+ @Override
+ public String reasonPhrase() {
+ return this.response.reasonPhrase();
+ }
+
+ @Override
+ public boolean isStatusCodeClass(StatusCodeClass statusCodeClass) {
+ return this.response.isStatusCodeClass(statusCodeClass);
+ }
+
+ @Override
+ public String httpVersion() {
+ return this.response.httpVersion();
+ }
+
+ @Override
+ public List
+ * Created by vaycore on 2024-05-06.
+ */
+public class HttpServiceImpl implements HttpService {
+
+ private final IHttpService httpService;
+
+ public HttpServiceImpl(IHttpService httpService) {
+ this.httpService = httpService;
+ }
+
+ @Override
+ public String host() {
+ return this.httpService.getHost();
+ }
+
+ @Override
+ public int port() {
+ return this.httpService.getPort();
+ }
+
+ @Override
+ public boolean secure() {
+ return "https".equals(httpService.getProtocol());
+ }
+
+ @Override
+ public String ipAddress() {
+ String host = httpService.getHost();
+ try {
+ InetAddress ip = InetAddress.getByName(host);
+ return ip.getHostAddress();
+ } catch (UnknownHostException e) {
+ return "0.0.0.0";
+ }
+ }
+}
diff --git a/src/main/java/burp/hae/montoya/logging/LoggingImpl.java b/src/main/java/burp/hae/montoya/logging/LoggingImpl.java
new file mode 100644
index 0000000..c10eb53
--- /dev/null
+++ b/src/main/java/burp/hae/montoya/logging/LoggingImpl.java
@@ -0,0 +1,79 @@
+package burp.hae.montoya.logging;
+
+import burp.IBurpExtenderCallbacks;
+import burp.api.montoya.logging.Logging;
+import burp.vaycore.common.utils.StringUtils;
+
+import java.io.PrintStream;
+
+/**
+ *
+ * Created by vaycore on 2024-05-06.
+ */
+public class LoggingImpl implements Logging {
+
+ private final IBurpExtenderCallbacks callbacks;
+ private final PrintStream stdOut;
+ private final PrintStream stdErr;
+
+ public LoggingImpl(IBurpExtenderCallbacks callbacks) {
+ this.callbacks = callbacks;
+ this.stdOut = new PrintStream(this.callbacks.getStdout());
+ this.stdErr = new PrintStream(this.callbacks.getStderr());
+ }
+
+ @Override
+ public PrintStream output() {
+ return this.stdOut;
+ }
+
+ @Override
+ public PrintStream error() {
+ return this.stdErr;
+ }
+
+ @Override
+ public void logToOutput(String message) {
+ this.callbacks.printOutput(message);
+ }
+
+ @Override
+ public void logToError(String message) {
+ this.logToError(message, null);
+ }
+
+ @Override
+ public void logToError(String message, Throwable cause) {
+ if (StringUtils.isNotEmpty(message)) {
+ this.callbacks.printError(message);
+ }
+ if (cause != null) {
+ cause.printStackTrace(this.stdErr);
+ }
+ }
+
+ @Override
+ public void logToError(Throwable cause) {
+ this.logToError(null, cause);
+ }
+
+ @Override
+ public void raiseDebugEvent(String message) {
+
+ }
+
+ @Override
+ public void raiseInfoEvent(String message) {
+
+ }
+
+ @Override
+ public void raiseErrorEvent(String message) {
+
+ }
+
+ @Override
+ public void raiseCriticalEvent(String message) {
+
+ }
+}
diff --git a/src/main/java/burp/hae/montoya/proxy/ProxyImpl.java b/src/main/java/burp/hae/montoya/proxy/ProxyImpl.java
new file mode 100644
index 0000000..4ac5095
--- /dev/null
+++ b/src/main/java/burp/hae/montoya/proxy/ProxyImpl.java
@@ -0,0 +1,68 @@
+package burp.hae.montoya.proxy;
+
+import burp.IBurpExtenderCallbacks;
+import burp.api.montoya.core.Registration;
+import burp.api.montoya.proxy.*;
+import burp.api.montoya.proxy.http.ProxyRequestHandler;
+import burp.api.montoya.proxy.http.ProxyResponseHandler;
+import burp.api.montoya.proxy.websocket.ProxyWebSocketCreationHandler;
+
+import java.util.List;
+
+/**
+ *
+ * Created by vaycore on 2024-05-06.
+ */
+public class ProxyImpl implements Proxy {
+
+ private final IBurpExtenderCallbacks callbacks;
+
+ public ProxyImpl(IBurpExtenderCallbacks callbacks) {
+ this.callbacks = callbacks;
+ }
+
+ @Override
+ public void enableIntercept() {
+
+ }
+
+ @Override
+ public void disableIntercept() {
+
+ }
+
+ @Override
+ public List
+ * Created by vaycore on 2024-05-07.
+ */
+public class EditorCreationContextImpl implements EditorCreationContext, ToolSource {
+
+ private final ToolType type;
+ private final EditorMode mode;
+
+ public EditorCreationContextImpl(ToolType type) {
+ this(type, EditorMode.READ_ONLY);
+ }
+
+ public EditorCreationContextImpl(ToolType type, EditorMode mode) {
+ this.type = type;
+ this.mode = mode;
+ }
+
+ @Override
+ public ToolSource toolSource() {
+ return this;
+ }
+
+ @Override
+ public EditorMode editorMode() {
+ return this.mode;
+ }
+
+ @Override
+ public ToolType toolType() {
+ return this.type;
+ }
+
+ @Override
+ public boolean isFromTool(ToolType... toolType) {
+ return false;
+ }
+}
diff --git a/src/main/java/burp/hae/montoya/ui/HttpRequestEditorImpl.java b/src/main/java/burp/hae/montoya/ui/HttpRequestEditorImpl.java
new file mode 100644
index 0000000..e9cbe36
--- /dev/null
+++ b/src/main/java/burp/hae/montoya/ui/HttpRequestEditorImpl.java
@@ -0,0 +1,77 @@
+package burp.hae.montoya.ui;
+
+import burp.IBurpExtenderCallbacks;
+import burp.IExtensionHelpers;
+import burp.IHttpService;
+import burp.IMessageEditor;
+import burp.api.montoya.http.HttpService;
+import burp.api.montoya.http.message.requests.HttpRequest;
+import burp.api.montoya.ui.Selection;
+import burp.api.montoya.ui.editor.HttpRequestEditor;
+import burp.hae.MessageEditorController;
+
+import java.awt.*;
+import java.util.Optional;
+
+/**
+ *
+ * Created by vaycore on 2024-05-06.
+ */
+public class HttpRequestEditorImpl implements HttpRequestEditor {
+
+ private final IExtensionHelpers helpers;
+ private final IMessageEditor editor;
+ private final MessageEditorController controller;
+ private HttpRequest request;
+
+ public HttpRequestEditorImpl(IBurpExtenderCallbacks callbacks, MessageEditorController controller) {
+ this.helpers = callbacks.getHelpers();
+ this.editor = callbacks.createMessageEditor(controller, false);
+ this.controller = controller;
+ }
+
+ @Override
+ public HttpRequest getRequest() {
+ return this.request;
+ }
+
+ @Override
+ public void setRequest(HttpRequest request) {
+ byte[] message = request.toByteArray().getBytes();
+ HttpService service = request.httpService();
+ this.request = request;
+ this.editor.setMessage(message, true);
+ // 设置 HttpServer
+ if (service != null) {
+ IHttpService httpService = this.helpers.buildHttpService(service.host(), service.port(), service.secure());
+ this.controller.setHttpService(httpService);
+ }
+ this.controller.setRequest(message);
+ }
+
+ @Override
+ public void setSearchExpression(String expression) {
+
+ }
+
+ @Override
+ public boolean isModified() {
+ return false;
+ }
+
+ @Override
+ public int caretPosition() {
+ return 0;
+ }
+
+ @Override
+ public Optional
+ * Created by vaycore on 2024-05-06.
+ */
+public class HttpResponseEditorImpl implements HttpResponseEditor {
+
+ private final IMessageEditor editor;
+ private final MessageEditorController controller;
+ private HttpResponse response;
+
+ public HttpResponseEditorImpl(IBurpExtenderCallbacks callbacks, MessageEditorController controller) {
+ this.editor = callbacks.createMessageEditor(controller, false);
+ this.controller = controller;
+ }
+
+ @Override
+ public HttpResponse getResponse() {
+ return this.response;
+ }
+
+ @Override
+ public void setResponse(HttpResponse response) {
+ byte[] message = response.toByteArray().getBytes();
+ this.response = response;
+ this.editor.setMessage(message, false);
+ this.controller.setResponse(message);
+ }
+
+ @Override
+ public void setSearchExpression(String expression) {
+
+ }
+
+ @Override
+ public boolean isModified() {
+ return false;
+ }
+
+ @Override
+ public int caretPosition() {
+ return 0;
+ }
+
+ @Override
+ public Optional
+ * Created by vaycore on 2024-05-06.
+ */
+public class UserInterfaceImpl implements UserInterface {
+
+ private final IBurpExtenderCallbacks callbacks;
+ private ExtensionProvidedHttpRequestEditor httpRequestEditor;
+ private ExtensionProvidedHttpResponseEditor httpResponseEditor;
+ private final MessageEditorController messageEditorController;
+
+ public UserInterfaceImpl(IBurpExtenderCallbacks callbacks) {
+ this.callbacks = callbacks;
+ this.messageEditorController = new MessageEditorController();
+ }
+
+ @Override
+ public MenuBar menuBar() {
+ return null;
+ }
+
+ @Override
+ public Registration registerSuiteTab(String title, Component component) {
+ this.callbacks.customizeUiComponent(component);
+ return null;
+ }
+
+ @Override
+ public Registration registerContextMenuItemsProvider(ContextMenuItemsProvider provider) {
+ return null;
+ }
+
+ @Override
+ public Registration registerHttpRequestEditorProvider(HttpRequestEditorProvider provider) {
+ EditorCreationContextImpl context = new EditorCreationContextImpl(ToolType.PROXY);
+ httpRequestEditor = provider.provideHttpRequestEditor(context);
+ return new Registration() {
+ @Override
+ public boolean isRegistered() {
+ return UserInterfaceImpl.this.httpRequestEditor != null;
+ }
+
+ @Override
+ public void deregister() {
+ UserInterfaceImpl.this.httpRequestEditor = null;
+ }
+ };
+ }
+
+ @Override
+ public Registration registerHttpResponseEditorProvider(HttpResponseEditorProvider provider) {
+ EditorCreationContextImpl context = new EditorCreationContextImpl(ToolType.PROXY);
+ httpResponseEditor = provider.provideHttpResponseEditor(context);
+ return new Registration() {
+ @Override
+ public boolean isRegistered() {
+ return UserInterfaceImpl.this.httpResponseEditor != null;
+ }
+
+ @Override
+ public void deregister() {
+ UserInterfaceImpl.this.httpResponseEditor = null;
+ }
+ };
+ }
+
+ @Override
+ public Registration registerWebSocketMessageEditorProvider(WebSocketMessageEditorProvider provider) {
+ return null;
+ }
+
+ @Override
+ public RawEditor createRawEditor(EditorOptions... options) {
+ return null;
+ }
+
+ @Override
+ public WebSocketMessageEditor createWebSocketMessageEditor(EditorOptions... options) {
+ return null;
+ }
+
+ @Override
+ public HttpRequestEditor createHttpRequestEditor(EditorOptions... options) {
+ return new HttpRequestEditorImpl(this.callbacks, this.messageEditorController);
+ }
+
+ @Override
+ public HttpResponseEditor createHttpResponseEditor(EditorOptions... options) {
+ return new HttpResponseEditorImpl(this.callbacks, this.messageEditorController);
+ }
+
+ @Override
+ public void applyThemeToComponent(Component component) {
+
+ }
+
+ @Override
+ public Theme currentTheme() {
+ return null;
+ }
+
+ @Override
+ public Font currentEditorFont() {
+ return null;
+ }
+
+ @Override
+ public Font currentDisplayFont() {
+ return null;
+ }
+
+ @Override
+ public SwingUtils swingUtils() {
+ return null;
+ }
+}
diff --git a/src/main/java/burp/hae/montoya/utilities/ByteUtilsImpl.java b/src/main/java/burp/hae/montoya/utilities/ByteUtilsImpl.java
new file mode 100644
index 0000000..624ab03
--- /dev/null
+++ b/src/main/java/burp/hae/montoya/utilities/ByteUtilsImpl.java
@@ -0,0 +1,80 @@
+package burp.hae.montoya.utilities;
+
+import burp.IBurpExtenderCallbacks;
+import burp.IExtensionHelpers;
+import burp.api.montoya.utilities.ByteUtils;
+
+import java.util.regex.Pattern;
+
+/**
+ *
+ * Created by vaycore on 2024-05-06.
+ */
+public class ByteUtilsImpl implements ByteUtils {
+
+ private final IExtensionHelpers helpers;
+
+ public ByteUtilsImpl(IBurpExtenderCallbacks callbacks) {
+ this.helpers = callbacks.getHelpers();
+ }
+
+ @Override
+ public int indexOf(byte[] data, byte[] searchTerm) {
+ return this.indexOf(data, searchTerm, false);
+ }
+
+ @Override
+ public int indexOf(byte[] data, byte[] searchTerm, boolean caseSensitive) {
+ return this.indexOf(data, searchTerm, caseSensitive, 0, data.length);
+ }
+
+ @Override
+ public int indexOf(byte[] data, byte[] searchTerm, boolean caseSensitive, int from, int to) {
+ return this.helpers.indexOf(data, searchTerm, caseSensitive, from, to);
+ }
+
+ @Override
+ public int indexOf(byte[] data, Pattern pattern) {
+ return 0;
+ }
+
+ @Override
+ public int indexOf(byte[] data, Pattern pattern, int from, int to) {
+ return 0;
+ }
+
+ @Override
+ public int countMatches(byte[] data, byte[] searchTerm) {
+ return 0;
+ }
+
+ @Override
+ public int countMatches(byte[] data, byte[] searchTerm, boolean caseSensitive) {
+ return 0;
+ }
+
+ @Override
+ public int countMatches(byte[] data, byte[] searchTerm, boolean caseSensitive, int from, int to) {
+ return 0;
+ }
+
+ @Override
+ public int countMatches(byte[] data, Pattern pattern) {
+ return 0;
+ }
+
+ @Override
+ public int countMatches(byte[] data, Pattern pattern, int from, int to) {
+ return 0;
+ }
+
+ @Override
+ public String convertToString(byte[] bytes) {
+ return this.helpers.bytesToString(bytes);
+ }
+
+ @Override
+ public byte[] convertFromString(String string) {
+ return this.helpers.stringToBytes(string);
+ }
+}
diff --git a/src/main/java/burp/hae/montoya/utilities/UtilitiesImpl.java b/src/main/java/burp/hae/montoya/utilities/UtilitiesImpl.java
new file mode 100644
index 0000000..c92f74e
--- /dev/null
+++ b/src/main/java/burp/hae/montoya/utilities/UtilitiesImpl.java
@@ -0,0 +1,62 @@
+package burp.hae.montoya.utilities;
+
+import burp.IBurpExtenderCallbacks;
+import burp.api.montoya.utilities.*;
+
+/**
+ *
+ * Created by vaycore on 2024-05-06.
+ */
+public class UtilitiesImpl implements Utilities {
+
+ private final ByteUtilsImpl byteUtils;
+
+ public UtilitiesImpl(IBurpExtenderCallbacks callbacks) {
+ this.byteUtils = new ByteUtilsImpl(callbacks);
+ }
+
+ @Override
+ public Base64Utils base64Utils() {
+ return null;
+ }
+
+ @Override
+ public ByteUtilsImpl byteUtils() {
+ return byteUtils;
+ }
+
+ @Override
+ public CompressionUtils compressionUtils() {
+ return null;
+ }
+
+ @Override
+ public CryptoUtils cryptoUtils() {
+ return null;
+ }
+
+ @Override
+ public HtmlUtils htmlUtils() {
+ return null;
+ }
+
+ @Override
+ public NumberUtils numberUtils() {
+ return null;
+ }
+
+ @Override
+ public RandomUtils randomUtils() {
+ return null;
+ }
+
+ @Override
+ public StringUtils stringUtils() {
+ return null;
+ }
+
+ @Override
+ public URLUtils urlUtils() {
+ return null;
+ }
+}
diff --git a/src/main/java/burp/vaycore/onescan/common/Constants.java b/src/main/java/burp/vaycore/onescan/common/Constants.java
index 835cbc1..521c00a 100644
--- a/src/main/java/burp/vaycore/onescan/common/Constants.java
+++ b/src/main/java/burp/vaycore/onescan/common/Constants.java
@@ -9,7 +9,7 @@ public interface Constants {
// 插件信息
String PLUGIN_NAME = "OneScan";
- String PLUGIN_VERSION = "1.5.2";
+ String PLUGIN_VERSION = "1.6.0";
boolean DEBUG = false;
// 插件启动显示的信息
diff --git a/src/main/java/burp/vaycore/onescan/ui/tab/config/OtherTab.java b/src/main/java/burp/vaycore/onescan/ui/tab/config/OtherTab.java
index fef6d1f..bd565ad 100644
--- a/src/main/java/burp/vaycore/onescan/ui/tab/config/OtherTab.java
+++ b/src/main/java/burp/vaycore/onescan/ui/tab/config/OtherTab.java
@@ -1,9 +1,9 @@
package burp.vaycore.onescan.ui.tab.config;
+import burp.hae.HaE;
import burp.vaycore.common.helper.UIHelper;
import burp.vaycore.common.layout.HLayout;
import burp.vaycore.common.utils.StringUtils;
-import burp.vaycore.hae.HaE;
import burp.vaycore.onescan.common.Config;
import burp.vaycore.onescan.manager.FpManager;
import burp.vaycore.onescan.ui.base.BaseConfigTab;