Skip to content

Commit

Permalink
Added default context menu entries: decoder++, droopescan, mooscan, w…
Browse files Browse the repository at this point in the history
…pscan, bfac, gobuster, nikto, wfuzz, sqlmap, sslscan, sslyze, testssl

Added additional placeholders: host, port, protocol, url, path, query, method, cookies, request/response, body
Enhanced logging
  • Loading branch information
bytebutcher authored and Thomas Engel committed Jan 9, 2020
1 parent 7332758 commit c948668
Show file tree
Hide file tree
Showing 12 changed files with 845 additions and 272 deletions.
23 changes: 22 additions & 1 deletion BappDescription.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,30 @@


<ul>
<li><strong>%H:</strong> will be replaced with the host</li>

<li><strong>%P:</strong> will be replaced with the port</li>

<li><strong>%T:</strong> will be replaced with the protocol</li>

<li><strong>%U:</strong> will be replaced with the url</li>

<li><strong>%A:</strong> will be replaced with the url path</li>

<li><strong>%Q:</strong> will be replaced with the url query</li>

<li><strong>%C:</strong> will be replaced with the cookies</li>

<li><strong>%M:</strong> will be replaced with the HTTP-method</li>

<li><strong>%S:</strong> will be replaced with the selected text</li>

<li><strong>%F:</strong> will be replaced with the path to a temporary file which contains the selected text</li></ul>
<li><strong>%F:</strong> will be replaced with the path to a temporary file containing the selected text</li></ul>

<li><strong>%R:</strong> will be replaced with the path to a temporary file containing the content of the focused request/response</li>

<li><strong>%B:</strong> will be replaced with the path to a temporary file containing the body of the focused request/response</li>

</li>

<li><strong>Run in terminal:</strong> defines whether a terminal-window should appear in which the configured command is executed. By default "xterm" is used as terminal-emulator. You can change the terminal-emulator in the "Miscellaneous Options" to your liking.</li>
Expand Down
4 changes: 2 additions & 2 deletions BappManifest.bmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Uuid: f089f1ad056545489139cb9f32900f8e
ExtensionType: 1
Name: Custom Send To
RepoName: custom-send-to
ScreenVersion: 0.94
ScreenVersion: 0.98
SerialVersion: 1
MinPlatformVersion: 0
ProOnly: False
Author: Thomas Engel
ShortDescription: Add a customizable "Send to..." menu to the context menu
EntryPoint: burp-send-to-extension/build/libs/burp-send-to-extension-0.93.jar
EntryPoint: burp-send-to-extension/build/libs/burp-send-to-extension-0.98.jar
BuildCommand: cd burp-send-to-extension; ./gradlew fatJar
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ After loading the extension the "Send to"-Tab contains all necessary options to
New context-menu-entries can be added using the "Add"-button. Each entry consists of following fields:
* **Name:** the name of the context-menu-entry.
* **Command:** the command to be executed. You can use following placeholders:
* **%H:** will be replaced with the host
* **%P:** will be replaced with the port
* **%T:** will be replaced with the protocol
* **%U:** will be replaced with the url
* **%A:** will be replaced with the url path
* **%Q:** will be replaced with the url query
* **%C:** will be replaced with the cookies
* **%M:** will be replaced with the HTTP-method
* **%S:** will be replaced with the selected text
* **%F:** will be replaced with the path to a temporary file which contains the selected text
* **%F:** will be replaced with the path to a temporary file containing the selected text
* **%R:** will be replaced with the path to a temporary file containing the content of the focused request/response
* **%B:** will be replaced with the path to a temporary file containing the body of the focused request/response
* **Group:** the name of the sub-menu in which this entry will be shown. Can be left blank.
* **Run in terminal:** defines whether a terminal-window should appear in which the configured command is executed. By default "xterm" is used as terminal-emulator. You can change the terminal-emulator in the "Miscellaneous Options" to your liking.
* **Show preview:** gives you the chance to preview and change the command before executing it.
Expand Down
2 changes: 1 addition & 1 deletion burp-send-to-extension/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'java'

group 'net.bytebutcher'
version '0.95'
version '0.98'

sourceCompatibility = 1.8

Expand Down
166 changes: 93 additions & 73 deletions burp-send-to-extension/src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
@@ -1,73 +1,93 @@
package burp;

import net.bytebutcher.burpsendtoextension.gui.SendToContextMenu;
import net.bytebutcher.burpsendtoextension.gui.SendToTab;
import net.bytebutcher.burpsendtoextension.gui.SendToTable;
import net.bytebutcher.burpsendtoextension.models.Config;
import net.bytebutcher.burpsendtoextension.utils.OsUtils;

import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.PrintWriter;

public class BurpExtender implements IBurpExtender, ITab {

private JPanel tab = null;
private SendToTab sendToTab = null;
private IBurpExtenderCallbacks callbacks;
private SendToContextMenu sendToContextMenu;
private Config config;
private SendToTable sendToTable;
private PrintWriter stderr;

@Override
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
this.callbacks = callbacks;
this.callbacks.setExtensionName("Send to");
this.stderr = new PrintWriter(callbacks.getStderr(), true);
this.config = new Config(this);
this.sendToTab = new SendToTab(this);
this.sendToContextMenu = new SendToContextMenu(this, this.sendToTab.getSendToTableListener());
this.callbacks.registerContextMenuFactory(sendToContextMenu);
this.tab = sendToTab.getRootPanel();
this.sendToTable = this.sendToTab.getSendToTable();
this.sendToTable.addCommandObjects(this.config.getSendToTableData());
callbacks.addSuiteTab(this);
}

@Override
public String getTabCaption() {
return "Send to";
}

@Override
public Component getUiComponent() {
return this.tab;
}

public ImageIcon createImageIcon(String path, String description, int width, int height) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
ImageIcon icon = new ImageIcon(imgURL);
Image image = icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH);
return new ImageIcon(image, description);
} else {
stderr.println("Couldn't find file: " + path);
return null;
}
}

public Config getConfig() {
return this.config;
}

public JFrame getParent() {
return this.sendToTab.getParent();
}

public IBurpExtenderCallbacks getCallbacks() {
return this.callbacks;
}

}
package burp;

import net.bytebutcher.burpsendtoextension.gui.SendToContextMenu;
import net.bytebutcher.burpsendtoextension.gui.SendToTab;
import net.bytebutcher.burpsendtoextension.gui.SendToTable;
import net.bytebutcher.burpsendtoextension.models.Config;
import net.bytebutcher.burpsendtoextension.utils.OsUtils;

import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.PrintWriter;

public class BurpExtender implements IBurpExtender, ITab {

private JPanel tab = null;
private SendToTab sendToTab = null;
private IBurpExtenderCallbacks callbacks;
private SendToContextMenu sendToContextMenu;
private Config config;
private SendToTable sendToTable;

private static PrintWriter stdout;
private static PrintWriter stderr;

@Override
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
this.callbacks = callbacks;
initLogHandler(callbacks);
BurpExtender.printOut("Initializing Send to Extension...");
this.callbacks.setExtensionName("Send to");
BurpExtender.printOut("Initializing config...");
this.config = new Config(this);
BurpExtender.printOut("Initializing tab...");
this.sendToTab = new SendToTab(this);
BurpExtender.printOut("Registering context menu...");
this.sendToContextMenu = new SendToContextMenu(this, this.sendToTab.getSendToTableListener());
this.callbacks.registerContextMenuFactory(sendToContextMenu);
this.tab = sendToTab.getRootPanel();
BurpExtender.printOut("Loading table data...");
this.sendToTable = this.sendToTab.getSendToTable();
this.sendToTable.addCommandObjects(this.config.getSendToTableData());
callbacks.addSuiteTab(this);
BurpExtender.printOut("----------------------------------------------------------------------");
}

private void initLogHandler(IBurpExtenderCallbacks callbacks) {
this.stderr = new PrintWriter(callbacks.getStderr(), true);
this.stdout = new PrintWriter(callbacks.getStdout(), true);
}

@Override
public String getTabCaption() {
return "Send to";
}

@Override
public Component getUiComponent() {
return this.tab;
}

public ImageIcon createImageIcon(String path, String description, int width, int height) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
ImageIcon icon = new ImageIcon(imgURL);
Image image = icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH);
return new ImageIcon(image, description);
} else {
BurpExtender.printErr("Couldn't find file: " + path);
return null;
}
}

public Config getConfig() {
return this.config;
}

public JFrame getParent() {
return this.sendToTab.getParent();
}

public IBurpExtenderCallbacks getCallbacks() {
return this.callbacks;
}

public static void printOut(String s) {
stdout.println(s);
}

public static void printErr(String s) {
stderr.println(s);
}
}
Loading

0 comments on commit c948668

Please sign in to comment.