The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

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