Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bytebutcher/burp-send-to
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.95
Choose a base ref
...
head repository: bytebutcher/burp-send-to
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 2, 2019

  1. Copy the full SHA
    30bc11a View commit details
  2. Copy the full SHA
    7332758 View commit details

Commits on Jan 9, 2020

  1. Added default context menu entries: decoder++, droopescan, mooscan, w…

    …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
    bytebutcher authored and Thomas Engel committed Jan 9, 2020
    Copy the full SHA
    c948668 View commit details

Commits on Jan 10, 2020

  1. Context menu entries are now enabled/disabled when placeholders can n…

    …ot build correctly (e.g. no selected text, no url-query, etc.).
    
    Added additional placeholder %E which returns the path to a temporary file containing the HTTP-request/-response-header.
     The placeholder %C (Cookie) will now also return cookies found in the http response.
     The tooltip-help is now shown for 10 seconds instead of 5 since it now contain more text (more placeholders).
     The remove-button now removes all selected entries.
     Added new default context-menu entries which illustrate the usage of the individual placeholders.
     Refactored SendToContextMenu.java (480 loc -> 245 loc). All placeholders were extracted into individual classes. This makes it much more easy and safe to add new placeholders. Code should now be more readable, too.
    bytebutcher authored and Thomas Engel committed Jan 10, 2020
    Copy the full SHA
    252162d View commit details
  2. Updated README and metadata.

    bytebutcher authored and Thomas Engel committed Jan 10, 2020
    Copy the full SHA
    20d4d49 View commit details

Commits on Jan 11, 2020

  1. Fixed default context menu entries - show in terminal and output shou…

    …ld replace selection do not mix well
    bytebutcher committed Jan 11, 2020
    Copy the full SHA
    1b4dd4c View commit details
  2. Redesigned add dialog to allow only either 'run in terminal' or 'outp…

    …ut should replace selection' to be selected cause terminals can not return any output.
    bytebutcher committed Jan 11, 2020
    Copy the full SHA
    b9767c6 View commit details

Commits on Jan 12, 2020

  1. Context menu entries can now handle multiple selected messages at once.

    Added "run in background" option which was removed by accident when redesigning the send-to-add-dialog.
    bytebutcher committed Jan 12, 2020
    Copy the full SHA
    7b1d82b View commit details
  2. Context menu entries can now be executed when at least one of the sel…

    …ected messages is valid.
    
    Added text into context menu entry which shows how may of the selected messages are valid (e.g. 2/5).
    bytebutcher committed Jan 12, 2020
    Copy the full SHA
    3133fb6 View commit details
  3. Copy the full SHA
    df4d33a View commit details
  4. Added additional code to ensure that only commands which should repla…

    …ce selection wait for command output
    bytebutcher committed Jan 12, 2020
    Copy the full SHA
    f4bfa2a View commit details

Commits on Jan 26, 2020

  1. Added feature which makes it possible to choose within context menu w…

    …hether information (e.g. HTTP-Headers, HTTP-Body, HTTP-Message) should be taken from request or response.
    bytebutcher committed Jan 26, 2020
    Copy the full SHA
    f2f667e View commit details

Commits on Jan 29, 2020

  1. Copy the full SHA
    4c7d1c2 View commit details
  2. Copy the full SHA
    eab445b View commit details

Commits on Feb 16, 2020

  1. Updated build notes

    bytebutcher committed Feb 16, 2020
    Copy the full SHA
    b51c139 View commit details

Commits on Feb 18, 2020

  1. Added feature to customize placeholder behaviour using the "Advanced"…

    …-button in the add-/edit-dialog which plays a role when multiple messages are selected.
    
    Fixed state of context menu entries which should replace output when multiple messages are selected and when no selection was made by the user. In both cases they are now disabled.
    bytebutcher committed Feb 18, 2020
    Copy the full SHA
    431766c View commit details
  2. Fixed Advanced Dialog when not existing placeholders are used. They a…

    …re ignored now.
    
    Refactored placeholders by splitting placeholders into placeholder model and placeholder parser.
    bytebutcher committed Feb 18, 2020
    Copy the full SHA
    61fc269 View commit details
  3. Changed default placeholder behaviour from string-separated to comman…

    …d-separated since this is what one might expect when selecting multiple messages.
    bytebutcher committed Feb 18, 2020
    Copy the full SHA
    182bd66 View commit details
  4. Adjusted README.md by adding additional images and description regard…

    …ing placeholder behaviour feature.
    
    Adjusted extension version within BappManifest.bmf to 1.3.
    bytebutcher committed Feb 18, 2020
    Copy the full SHA
    bf72fed View commit details

Commits on Feb 21, 2020

  1. Added feature to let user chooce the run-in-terminal-behaviour. It is…

    … not possible to select whether multiple commands should be run in separate or in single terminal.
    
    Added additional configuration options to select whether a warning/choice dialog should be shown or a default choice (e.g. Run in separate terminals/Run in single terminal) should be taken.
    Corrected default entries (commands can not run in terminal and at the same time replace selected text).
    bytebutcher committed Feb 21, 2020
    Copy the full SHA
    1c275c4 View commit details
  2. Minor refactorings, visual changes in the table layout and default ch…

    …oice fix in dialog.
    
    Previously the options "Run in Terminal" and "Output should replace selection" were individual columns within the send-to table. The column for the setting "Run in Background" was completely missing. Since these choices are binary (only one setting can be selected at once), they are now represented in one column as human readable text ("Run in Background", "Run in Terminal", "Output should replace Selection").
    Fixed focusing the default choice in the SendToRunInTerminalBehaviourChoiceDialog.
    bytebutcher committed Feb 21, 2020
    Copy the full SHA
    f39da06 View commit details
  3. Updated README.md

    bytebutcher committed Feb 21, 2020
    Copy the full SHA
    645cb8c View commit details
  4. Updated README.md

    bytebutcher committed Feb 21, 2020
    Copy the full SHA
    026144e View commit details

Commits on Jan 17, 2021

  1. Copy the full SHA
    5907547 View commit details
  2. #2 Added ability to disable the functionality to 'Surround placeholde…

    …rs with single quotes automatically (safe mode)' globally
    bytebutcher committed Jan 17, 2021
    Copy the full SHA
    7e026eb View commit details
  3. Copy the full SHA
    c62b622 View commit details

Commits on Feb 6, 2021

  1. Copy the full SHA
    8e1a9e8 View commit details
  2. Copy the full SHA
    c04c688 View commit details

Commits on Nov 27, 2022

  1. Update README.md

    bytebutcher authored Nov 27, 2022
    Copy the full SHA
    2ddd164 View commit details
  2. Update README.md

    bytebutcher authored Nov 27, 2022
    Copy the full SHA
    db1e378 View commit details
Showing with 4,337 additions and 1,218 deletions.
  1. +2 −1 .gitignore
  2. +36 −4 BappDescription.html
  3. +2 −2 BappManifest.bmf
  4. +41 −7 README.md
  5. +2 −2 burp-send-to-extension/build.gradle
  6. +92 −73 burp-send-to-extension/src/main/java/burp/BurpExtender.java
  7. +246 −0 burp-send-to-extension/src/main/java/burp/Cookie.java
  8. +10 −0 burp-send-to-extension/src/main/java/burp/IRequestInfoWrapper.java
  9. +11 −0 burp-send-to-extension/src/main/java/burp/IRequestResponseHolder.java
  10. +10 −0 burp-send-to-extension/src/main/java/burp/IResponseInfoWrapper.java
  11. +68 −0 burp-send-to-extension/src/main/java/burp/RequestInfoWrapper.java
  12. +41 −0 burp-send-to-extension/src/main/java/burp/RequestResponseHolder.java
  13. +62 −0 burp-send-to-extension/src/main/java/burp/ResponseInfoWrapper.java
  14. +271 −0 burp-send-to-extension/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java
  15. +148 −0 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/builder/CommandBuilder.java
  16. +114 −0 ...o-extension/src/main/java/net/bytebutcher/burpsendtoextension/executioner/CommandExecutioner.java
  17. +95 −0 ...d-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddAdvancedDialog.form
  18. +144 −0 ...d-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddAdvancedDialog.java
  19. +41 −0 ...main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddAdvancedPlaceholderBehaviourPanel.form
  20. +118 −0 ...main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddAdvancedPlaceholderBehaviourPanel.java
  21. +191 −163 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddDialog.form
  22. +154 −66 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToAddDialog.java
  23. +47 −216 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToContextMenu.java
  24. +32 −0 ...end-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToContextMenuItem.java
  25. +75 −74 ...-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToPreviewDialog.form
  26. +157 −147 ...-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToPreviewDialog.java
  27. +112 −0 ...c/main/java/net/bytebutcher/burpsendtoextension/gui/SendToRunInTerminalBehaviourChoiceDialog.form
  28. +174 −0 ...c/main/java/net/bytebutcher/burpsendtoextension/gui/SendToRunInTerminalBehaviourChoiceDialog.java
  29. +325 −249 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToTab.form
  30. +94 −59 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToTab.java
  31. +8 −1 ...extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToTabSettingsContextMenu.java
  32. +62 −34 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToTable.java
  33. +8 −25 ...-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/SendToTableListener.java
  34. +118 −0 ...ion/src/main/java/net/bytebutcher/burpsendtoextension/gui/action/SendToContextMenuItemAction.java
  35. +1 −1 ...tension/src/main/java/net/bytebutcher/burpsendtoextension/gui/listener/ToolTipActionListener.java
  36. +18 −0 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/gui/util/SelectionUtil.java
  37. +243 −84 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/CommandObject.java
  38. +136 −10 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/Config.java
  39. +55 −0 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/Context.java
  40. +6 −0 ...o-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/ERunInTerminalBehaviour.java
  41. +28 −0 ...send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/ERuntimeBehaviour.java
  42. +71 −0 burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/Placeholders.java
  43. +34 −0 ...ion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/AbstractPlaceholder.java
  44. +22 −0 ...n/java/net/bytebutcher/burpsendtoextension/models/placeholder/AbstractRequestInfoPlaceholder.java
  45. +18 −0 .../main/java/net/bytebutcher/burpsendtoextension/models/placeholder/AbstractRequestPlaceholder.java
  46. +26 −0 ...et/bytebutcher/burpsendtoextension/models/placeholder/AbstractRequestResponseInfoPlaceholder.java
  47. +24 −0 ...va/net/bytebutcher/burpsendtoextension/models/placeholder/AbstractRequestResponsePlaceholder.java
  48. +76 −0 ...et/bytebutcher/burpsendtoextension/models/placeholder/AbstractRequestResponsePlaceholderBase.java
  49. +38 −0 ...sion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/CookiesPlaceholder.java
  50. +26 −0 ...tension/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/HostPlaceholder.java
  51. +30 −0 ...c/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpBodyToFilePlaceholder.java
  52. +30 −0 ...ain/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpContentLengthPlaceholder.java
  53. +35 −0 ...ain/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpHeadersToFilePlaceholder.java
  54. +24 −0 ...n/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpMethodPlaceholder.java
  55. +25 −0 ...n/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpRequestResponsePlaceholder.java
  56. +28 −0 ...c/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/HttpStatusCodePlaceholder.java
  57. +10 −0 ...-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/IPlaceholder.java
  58. +11 −0 ...sion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/IPlaceholderParser.java
  59. +9 −0 ...c/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/IPlaceholderParserFactory.java
  60. +24 −0 ...tension/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/PortPlaceholder.java
  61. +24 −0 ...ion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/ProtocolPlaceholder.java
  62. +39 −0 ...src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/SelectedTextPlaceholder.java
  63. +9 −0 ...in/java/net/bytebutcher/burpsendtoextension/models/placeholder/SelectedTextToFilePlaceholder.java
  64. +26 −0 ...sion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/UrlPathPlaceholder.java
  65. +25 −0 ...xtension/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/UrlPlaceholder.java
  66. +26 −0 ...ion/src/main/java/net/bytebutcher/burpsendtoextension/models/placeholder/UrlQueryPlaceholder.java
  67. +5 −0 ...utcher/burpsendtoextension/models/placeholder/behaviour/CommandSeparatedPlaceholderBehaviour.java
  68. +5 −0 ...tebutcher/burpsendtoextension/models/placeholder/behaviour/FileSeparatedPlaceholderBehaviour.java
  69. +5 −0 .../java/net/bytebutcher/burpsendtoextension/models/placeholder/behaviour/IPlaceholderBehaviour.java
  70. +14 −0 ...butcher/burpsendtoextension/models/placeholder/behaviour/StringSeparatedPlaceholderBehaviour.java
  71. BIN images/burp-send-to-extension-add-edit-dialog.png
  72. BIN images/burp-send-to-extension-advanced-dialog.png
  73. BIN images/burp-send-to-extension-context-menu-group.png
  74. BIN images/burp-send-to-extension-context-menu-repeater.png
  75. BIN images/burp-send-to-extension-context-menu-target-sitemap.png
  76. BIN images/burp-send-to-extension-intro.png
  77. BIN images/burp-send-to-extension-tab.png
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
burp-send-to-extension/build
burp-send-to-extension/.idea
burp-send-to-extension/.gradle
burp-send-to-extension/build
burp-send-to-extension/out
40 changes: 36 additions & 4 deletions BappDescription.html
Original file line number Diff line number Diff line change
@@ -11,22 +11,54 @@

<li><strong>Command:</strong> the command to be executed. You can use following placeholders:

<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>

<ul>
<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>
<li><strong>%F:</strong> will be replaced with the path to a temporary file containing the selected text</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>
<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>%E:</strong> will be replaced with the path to a temporary file containing the header 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>
</ul>

<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 "Terminal Options" to your liking.</li>

<li><strong>Show preview:</strong> gives you the chance to preview and change the command before executing it</li>

<li><strong>Output should replace selection:</strong> will replace the selection with the output of the to be executed command</li>
</ul>

<p>
In addition it is possible to customize how placeholders behave when multiple HTTP messages are selected by clicking the "Advanced"-button.
By default each selected HTTP message forms a separate command. However, it is also possible to join all values of a specific placeholder using a custom separator.
</p>

<p>After creating new context-menu-entries using the "Add"-button they can be edited or deleted again using the "Edit"- and "Remove"-button. In addition the order in which they appear in the context-menu can be altered using the "Up"- and "Down"-button.</p>

<p><b>Terminal Options</b></p>

<p>
The "Terminal Options" allow to configure the graphical terminal to use. In addition it is possible to specify how multiple commands should be run in terminal. Multiple commands can either be run sequential in a single terminal or in parallel in separate terminals. While it's possible to choose a default behaviour, the exact behaviour can also be selected via a dialog, everytime a send-to context menu entry is selected. However, if you prefer one behaviour all the time, this dialog can also be disabled.
</p>

<p><b>Context-Menu</b></p>

<p>The "Send to..." context-menu contains all entries which were added in the "Send to"-Tab.
4 changes: 2 additions & 2 deletions BappManifest.bmf
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ Uuid: f089f1ad056545489139cb9f32900f8e
ExtensionType: 1
Name: Custom Send To
RepoName: custom-send-to
ScreenVersion: 0.94
ScreenVersion: 1.4
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-1.4.jar
BuildCommand: cd burp-send-to-extension; ./gradlew fatJar
48 changes: 41 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,40 +2,73 @@

Adds a customizable "Send to..."-context-menu to your BurpSuite.

![Burp-Send-To-Extension Tab](images/burp-send-to-extension-intro.png)

## Configuration

After loading the extension the "Send to"-Tab contains all necessary options to configure the "Send to"-context-menu.

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
* **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
* **%L:** will be replaced with the HTTP-content-length
* **%M:** will be replaced with the HTTP-method
* **%O:** will be replaced with the HTTP-status-code
* **%S:** will be replaced with the selected text
* **%F:** will be replaced with the path to a temporary file which contains the selected text
* **Group:** the name of the sub-menu in which this entry will be shown. Might be empty
* **%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
* **%E:** will be replaced with the path to a temporary file containing the header 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
* **Output should replace selection:** will replace the selection with the output of the to be executed command
* **Show preview:** gives you the chance to preview and change the command before executing it.
* **Output should replace selection:** will replace the selection with the output of the to be executed command.

![Burp-Send-To-Extension Add-/Edit-Dialog](images/burp-send-to-extension-add-edit-dialog.png)

In addition it is possible to customize how placeholders behave when multiple HTTP messages are selected by clicking the "Advanced"-button.
By default each selected HTTP message forms a separate command. However, it is also possible to join all values of a specific placeholder using a custom separator, or to store all values of a specific placeholder within a file.

![Burp-Send-To-Extension Advanced-Dialog](images/burp-send-to-extension-advanced-dialog.png)

After creating new context-menu-entries using the "Add"-button they can be edited or deleted again using the "Edit"- and "Remove"-button. In addition the order in which they appear in the context-menu can be altered using the "Up"- and "Down"-button.

![Burp-Send-To-Extension Tab](images/burp-send-to-extension-tab.png)

## Terminal Options

The "Terminal Options" allow to configure the graphical terminal to use. In addition it is possible to specify how multiple commands should be run in terminal. Multiple commands can either be run sequential in a single terminal or in parallel in separate terminals. While it's possible to choose a default behaviour, the exact behaviour can also be selected via a dialog, everytime a send-to context menu entry is selected. However, if you prefer one behaviour all the time, this dialog can also be disabled.

## Context-Menu

The "Send to..." context-menu contains all entries which were added in the "Send to"-Tab.
In addition you can add new entries via the "Custom command..."-context-menu-entry.

#### Request Field

![Burp-Send-To-Extension Context-Menu](images/burp-send-to-extension-context-menu-repeater.png)
![Burp-Send-To-Extension Context-Menu](images/burp-send-to-extension-context-menu-target-sitemap.png)
![Burp-Send-To-Extension Context-Menu Groups](images/burp-send-to-extension-context-menu-groups.png)

#### Proxy History

![Burp-Send-To-Extension Context-Menu](images/burp-send-to-extension-context-menu-target-sitemap.png)

## Save and load options

Usually the options of the "Send to"-Tab are saved automatically. However, if you switch computers you may save and load your current options. This can be done by clicking on the gear-symbol in the upper-left corner of the "Send to"-Tab and select the appropriate context-menu-entry.

![Burp-Send-To-Extension Options](images/burp-send-to-extension-options.png)

## Extending the Extension

Not satisfied yet? The [Wiki Page](https://github.com/bytebutcher/burp-send-to/wiki/Examples) lists some additional context-menu entries which might come in handy.

## Security Notes

Executing commands based on untrusted input always introduces the risk of command injection. This is especially true when using the **%S** placeholder. Thus it is recommended to always activate the **Show preview** option when using the **%S** placeholder and closely analyse commands in the preview window prior to execution.
@@ -47,6 +80,7 @@ Executing commands based on untrusted input always introduces the risk of comman
This project was built using IntelliJ and Gradle. When you make changes to the source (and especially the GUI) you should apply following settings within Intellij to make sure that everything builds successfully:
* File -> Settings -> Editor -> GUI Designer -> Generate GUI into: Java source
* File -> Settings -> Build, Execution, Deployment -> Compiler -> Build project automatically
* File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run using: IntelliJ IDEA

When the GUI is not updated correctly you may rebuild the project manually:
* Build -> Rebuild Project
4 changes: 2 additions & 2 deletions 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 '1.6'

sourceCompatibility = 1.8

@@ -13,7 +13,7 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.intellij:forms_rt:7.0.3'
compile 'net.portswigger.burp.extender:burp-extender-api:1.7.22'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
compile group: 'com.google.guava', name: 'guava', version: '27.0.1-jre'

}
165 changes: 92 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,92 @@
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 javax.swing.*;
import java.awt.*;
import java.io.PrintWriter;

public class BurpExtender implements IBurpExtender, ITab {

private JPanel tab = null;
private SendToContextMenu sendToContextMenu;
private SendToTable sendToTable;

private static IBurpExtenderCallbacks callbacks;
private static Config config;
private static SendToTab sendToTab = null;

private static PrintWriter stdout;
private static PrintWriter stderr;

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

private void initLogHandler(IBurpExtenderCallbacks callbacks) {
stderr = new PrintWriter(callbacks.getStderr(), true);
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 static JFrame getParent() {
return sendToTab.getParent();
}

public static IBurpExtenderCallbacks getCallbacks() {
return callbacks;
}

public static Config getConfig() {
return config;
}

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

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