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

Automatically change Response to a specific body

Farid110 | Last updated: Dec 08, 2021 04:35PM UTC

Hi I want to change Response body of some requests automatically but I don't know how to do it. For example I have a request sent to example.com/api/hello where the response of request leads me to example.com/api/howAreYou so I need to basically implement something that can distinguish between URLs and change my Respnse body to something specific. I managed to do it by intercepting Response Request MANUALLY (I had already added URLs to my Target scope) and since I'm using a python script for sending my requests, It is now wise to modify each Response manually. So I want implement something that can intercept and modify Response body AUTOMATICALLY. https://forum.portswigger.net/thread/automatically-change-response-a5c9cd47 I saw this thread which was similar to my question but I quite don't know how and where to get started. I can develop python script but I can't get docs and usage instruction of developing Extensions for it. I'll be really grateful if you could guide me in this specific scenario.

Liam, PortSwigger Agent | Last updated: Dec 09, 2021 12:36PM UTC

It should be possible to modify this extension: - https://github.com/HannahLaw-Portswigger/modifyResponse Please let us know if you need any further assistance.

Farid110 | Last updated: Dec 10, 2021 04:07PM UTC

Hi Thanks for your reply. I managed to grasp some info about Burp API. But I'm somehow stuck in conditioning based on specific URL. This script modifies body where Target HOST condition is met. But I can't use it because in my I use internal links of the same website. For example when script gets the Host of http://example.com/hello it returns "example.com" and it again returns the same answer for http://example.com/howAreYou which prevents me to modify response accordingly. I want separate modifications for each of those internal links and this script/plugin is unable to provide that feature. I even managed to modify the script and call getHeaders() method for REQUESTS, which somehow provides me the internal links but I can't get the URL of RESPONSE by any of these methods. I need something like getURL() for RESPONSE and burp API doesn't seem to be providing that. I'd be thankful if your could help me and lead me in a direction to solve it or even introduce a new script which is similar with what I'm trying to do. Thanks

Uthman, PortSwigger Agent | Last updated: Dec 13, 2021 04:28PM UTC