Burp Suite User Forum

Create new post

Fetch selected HTTP request/response without ContextMenu

skb | Last updated: Sep 20, 2023 03:12AM UTC

Hello, thank you for your efforts on Burp's cool MontoyaAPI. I am currently developing an extension, and I would like to retrieve selected HTTP requests or responses from the Proxy History table or any other HttpRequestResponseEditor. I am aware that we can pass the selected messages to the callback of the ContextMenu, but I would like to fetch them without using the ContextMenu. This functionality is similar to the "Send to Repeater" hotkey feature in Burp's default, which can retrieve and send the last selected requests in any editor or the HTTP Proxy table. For your information, I would like to implement these hotkey features in my extension, which is why I need the fetch feature. Thank you in advance for your assistance. :)

Michelle, PortSwigger Agent | Last updated: Sep 20, 2023 11:01AM UTC

Hi Can you tell us more about your extension and the functionality you are trying to create? What would the workflow look like? For example: Do you want to send a request from one of the default Burp tabs to your extension using a hotkey? Or do you want to send a request from your extension to one of the Burp tools? Are you using a custom message editor in your extension? If you can provide some more background on the extension you're trying to create, this will help us picture things better.

skb | Last updated: Oct 03, 2023 02:57AM UTC

Thanks for your reply. I want to send requests from Burp tools to my extension. For instance, I'm interested in retrieving the last selected message editor in ProxyHistory or the most recently selected messages in a ProxyHistory table. I'm aware that we can accomplish this by right-clicking to open the context menu. However, my goal is to obtain the last selected message(s) without having to open the context menu, similar to how Burp's default hotkey "Send to Repeater" operates. So, what I'm looking for is an API function like api.userInterface().getLastSelectedMessages(), which would require a tool scope parameter to specify where the messages originate from. It's worth noting that the specific functionality of my extension is not the primary concern here. It may use the message for analysis and data feeding or for message modification before sending it to Burp tools. Regardless of the extension's functionality, what I'm seeking is a general interface to retrieve the last selected messages within Burp tools. Please feel free to request any additional information you may need. Thank you in advance.

Michelle, PortSwigger Agent | Last updated: Oct 03, 2023 09:28AM UTC

I've been having a chat with the team about this. We do have a feature request in our system to add functionality for hotkeys to be assigned to extensions. Based on what you have described so far, I've added your interest in this feature. Would this give you enough of the functionality you are picturing? If you'd like to see more functionality, can you describe more details about the intentions behind what you want to create? Would you intend to work with single messages or also multiple messages that had been selected using shift+click? If we can understand more about the background and intentions for the idea of a function like api.userInterface().getLastSelectedMessages(), we can then review it in a wider context to determine all the options that could be used to achieve the aim.

Nico | Last updated: Dec 22, 2023 02:58PM UTC

Hi Michelle and skb, I would also like to express my interest in such a feature. My goal is to have a shortcut for the Copy Request Response extension [1]. Note that the same request was raised in [2]. I re-wrote the extension in Java and spent quite some time to find a solution. I was able to associate a shortcut with the context menu entry, however the listener for the shortcut is only active when right clicking on the message editor and having the mouse pointer on the "Extensions" entry, at that stage the convenience of the shortcut is completely lost. I could also set a general shortcut but then I don't have direct access to the object containing the request and response of the message of interest. TL;DR; I want to express a +1 of interest on the feature and possibly be notified when it will be shipped. Many thanks, Nico [1] https://github.com/portswigger/copy-request-response [2] https://forum.portswigger.net/thread/how-to-add-a-shortcut-of-extension-feature-45f263d4

Michelle, PortSwigger Agent | Last updated: Dec 22, 2023 03:21PM UTC

Hi We've added your interest in this feature. We'll post back here when there is an update.

Qusec | Last updated: Apr 03, 2024 08:55PM UTC

Any update on this? I am also looking forward to get the currently focused HttpRequestResponse object when a hotkey is pressed without the contextmenu event. Thanks

Michelle, PortSwigger Agent | Last updated: Apr 04, 2024 08:31AM UTC

Hi We are currently monitoring interest in this feature so it can be prioritized against other requests. I'll add your +1

Qusec | Last updated: Apr 04, 2024 01:30PM UTC

Thanks, meanwhile if you can tell us how does e.g. Ctrl + R works in picking up the correct request object from focused editor window to send to repeater tab? If there's some kind of workaround there?

Michelle, PortSwigger Agent | Last updated: Apr 05, 2024 07:57AM UTC

You can create context menus in extensions, could that be a possible workaround in your scenario? If not, can you tell us more about what you would like to achieve?

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.