Burp community forum

Modify Response depending on request

dan | Last updated: Apr 07, 2016 01:54PM UTC

Hi I need to write a python extension to modify responses depending on what the actual request was. Responses coming from server may be the same for different requests (like 400 Forbidden). I am using the IProxyListener interface, but I see that it handles requests and responses separately, ie(message is request OR message is not request) How can I adjust my response based on the what the actual request was?

PortSwigger Agent | Last updated: Apr 08, 2016 12:35PM UTC

When you intercept a response message via IProxyListener, you can directly query the request message (using IInterceptedProxyMessage.getMessageInfo().getRequest()) to decide whether the response should be modified.

You need to Log in to post a reply. Or register here, for free.