Burp Suite User Forum

Create new post

Burp Python Extension: Most efficient way to send request and grab response using makeHttpRequest?

Timmins, | Last updated: Jun 22, 2020 05:44PM UTC

Currently, I'm writing a plugin in Python to do some small tasks. Within this, I'd like to use Burp to send an HTTP request and then grab the body of that HTTP request and use the output for the corresponding HTTP request. My code is currently: def sendRequest(self,host,port,protoChoice,request): t = threading.Thread( target=self.makeBurpRequest, args=[host, port, protocol_choice, request] ) t.daemon = True t.start() def makeBurpRequest(self, host, port, protocol_choice, request): """Makes an HTTP request and writes the response to the response text area. """ resp = self.callbacks.makeHttpRequest( host, # string port, # int protol_choice, # bool request # bytes ) I'm wondering how I would go about efficiently grabbing the 'resp' value from the thread. I've tried using various methods such as using the Queue package and putting the response in that but it doesn't seem to grab the response. I there any method you'd recommend as a standard that would work efficiently within Burp? Cheers,

Timmins, | Last updated: Jun 23, 2020 08:35AM UTC

Using queue completely locks and freezes Burp and I have to kill the process.

Hannah, PortSwigger Agent | Last updated: Jun 23, 2020 09:22AM UTC

Have you had a look at any other extensions that use requests on different threads? Turbo Intruder or Logger++ might have some methods for this implemented. All of the BApp Store extensions have their code publicly available on GitHub - https://github.com/PortSwigger

Timmins, | Last updated: Jun 23, 2020 09:58AM UTC

I've tried looking at examples within Python and haven't made any luck. I'm guessing my use case is only possible in Java.

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