Burp Suite User Forum

Create new post

Changing Requests Leaving Burp using Burp Extension

Markus | Last updated: Sep 26, 2016 12:38PM UTC

Hello, I try to write an extension with Jython, that automatically changes requests leaving burp. For a simple example, I tried to change every occurence of "Gecko" in a request. (User-Agent field) I only process messages that fulfill conditions: tool == IBurpExtenderCallbacks.TOOL_PROXY and messageIsRequest. I then proceed to "bytesToString" my messageInfo.getRequest(), and take care that my string to replace, as well as my replacement string have the same forma, too. I then replace all occurences of "Gecko" with "XXXXX", stringToBytes the result, and messageInfo.setRequest() the request. Debug-comparisons (if stringA in stringB) before and after replacement confirm, that the string was really replaced. However, when I inspect the requests, all occurences of "Gecko" remained unchanged. Is this the correct way to modify requests before they are sent to the server? If not, what is the correct way? Thank you!

Burp User | Last updated: Sep 26, 2016 01:55PM UTC

Nevermind, I solved it myself. It did indeed work, it's just that Burp took its information before i set my hook. So the GUI displays the request before I edited it. Using Wireshark, I confirmed that the changes actually went through.

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