Skip to content

Commit

Permalink
Updated from Montoya API 0.10.1 to 2023.2
Browse files Browse the repository at this point in the history
  • Loading branch information
micahvandeusen committed Feb 14, 2023
1 parent 14513dd commit b0c6bc5
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 72 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ plugins {
}

group 'com.rsm.reproducer'
version '1.2'
version '1.3'

sourceCompatibility = '17'
targetCompatibility = '17'

repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}

dependencies {
implementation 'com.intellij:forms_rt:7.0.3'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.google.code.gson:gson:2.10'
implementation files('libs/montoya-api-0.10.1.jar')
implementation 'net.portswigger.burp.extensions:montoya-api:2023.2'
}

jar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rsm.reproducer;

import burp.api.montoya.MontoyaApi;
import burp.api.montoya.http.message.headers.HttpHeader;
import burp.api.montoya.http.message.HttpHeader;
import burp.api.montoya.http.message.params.HttpParameterType;
import burp.api.montoya.http.message.params.ParsedHttpParameter;
import burp.api.montoya.http.message.requests.HttpRequest;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rsm/reproducer/PowerShellBuilder.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rsm.reproducer;

import burp.api.montoya.MontoyaApi;
import burp.api.montoya.http.message.headers.HttpHeader;
import burp.api.montoya.http.message.HttpHeader;
import burp.api.montoya.http.message.params.HttpParameter;
import burp.api.montoya.http.message.params.HttpParameterType;
import burp.api.montoya.http.message.params.ParsedHttpParameter;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rsm/reproducer/PythonRequestBuilder.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.rsm.reproducer;

import burp.api.montoya.MontoyaApi;
import burp.api.montoya.http.ContentType;
import burp.api.montoya.http.message.headers.HttpHeader;
import burp.api.montoya.http.message.ContentType;
import burp.api.montoya.http.message.HttpHeader;
import burp.api.montoya.http.message.params.HttpParameterType;
import burp.api.montoya.http.message.params.ParsedHttpParameter;
import burp.api.montoya.http.message.requests.HttpRequest;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/rsm/reproducer/Reproducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class Reproducer implements BurpExtension
{
private MontoyaApi api;
private static final String VERSION = "1.2";
private static final String VERSION = "1.3";
private static final String EXTENSION_NAME = "Reproducer";
ReproducerTab tab;

Expand All @@ -41,7 +41,7 @@ public void initialize(MontoyaApi api)
}
private class ReproducerContextMenu implements ContextMenuItemsProvider
{
public List<JMenuItem> provideMenuItems(ContextMenuEvent event)
public List<Component> provideMenuItems(ContextMenuEvent event)
{
if (!event.selectedRequestResponses().isEmpty()) {
JMenuItem sendToReproducerMenuItem = new JMenuItem("Send to Reproducer");
Expand All @@ -61,23 +61,23 @@ public List<JMenuItem> provideMenuItems(ContextMenuEvent event)
});
JMenuItem copyPowerShellMenuItem = new JMenuItem("Copy as PowerShell command");
copyPowerShellMenuItem.addActionListener(e -> {
HttpRequest request = event.selectedRequestResponses().get(0).httpRequest();
HttpRequest request = event.selectedRequestResponses().get(0).request();
PowerShellBuilder prb = new PowerShellBuilder(api);
StringSelection stringSelection = new StringSelection(prb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
});
JMenuItem copyPythonRequestsMenuItem = new JMenuItem("Copy as Python Requests command");
copyPythonRequestsMenuItem.addActionListener(e -> {
HttpRequest request = event.selectedRequestResponses().get(0).httpRequest();
HttpRequest request = event.selectedRequestResponses().get(0).request();
PythonRequestBuilder prb = new PythonRequestBuilder(api);
StringSelection stringSelection = new StringSelection(prb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
});
JMenuItem copyJavaScriptFetchMenuItem = new JMenuItem("Copy as JavaScript Fetch command");
copyJavaScriptFetchMenuItem.addActionListener(e -> {
HttpRequest request = event.selectedRequestResponses().get(0).httpRequest();
HttpRequest request = event.selectedRequestResponses().get(0).request();
JavaScriptRequestBuilder jrb = new JavaScriptRequestBuilder(api);
StringSelection stringSelection = new StringSelection(jrb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Expand All @@ -92,7 +92,7 @@ else if (event.messageEditorRequestResponse().isPresent()) {
// This function may make HTTP calls, so run in a thread
new Thread(() -> {
try {
tab.addSelectionRequest(event.messageEditorRequestResponse().get().getRequestResponse());
tab.addSelectionRequest(event.messageEditorRequestResponse().get().requestResponse());
}
catch(Exception ex)
{
Expand All @@ -102,23 +102,23 @@ else if (event.messageEditorRequestResponse().isPresent()) {
});
JMenuItem copyPowerShellMenuItem = new JMenuItem("Copy as PowerShell command");
copyPowerShellMenuItem.addActionListener(e -> {
HttpRequest request = event.messageEditorRequestResponse().get().getRequestResponse().httpRequest();
HttpRequest request = event.messageEditorRequestResponse().get().requestResponse().request();
PowerShellBuilder prb = new PowerShellBuilder(api);
StringSelection stringSelection = new StringSelection(prb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
});
JMenuItem copyPythonRequestsMenuItem = new JMenuItem("Copy as Python Requests command");
copyPythonRequestsMenuItem.addActionListener(e -> {
HttpRequest request = event.messageEditorRequestResponse().get().getRequestResponse().httpRequest();
HttpRequest request = event.messageEditorRequestResponse().get().requestResponse().request();
PythonRequestBuilder prb = new PythonRequestBuilder(api);
StringSelection stringSelection = new StringSelection(prb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
});
JMenuItem copyJavaScriptFetchMenuItem = new JMenuItem("Copy as JavaScript Fetch command");
copyJavaScriptFetchMenuItem.addActionListener(e -> {
HttpRequest request = event.messageEditorRequestResponse().get().getRequestResponse().httpRequest();
HttpRequest request = event.messageEditorRequestResponse().get().requestResponse().request();
JavaScriptRequestBuilder jrb = new JavaScriptRequestBuilder(api);
StringSelection stringSelection = new StringSelection(jrb.build(request).toString());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Expand Down
Loading

0 comments on commit b0c6bc5

Please sign in to comment.