Skip to content

Instantly share code, notes, and snippets.

@antojoseph
Last active November 22, 2020 15:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save antojoseph/237a6fce5c016a70faf0b3495de4a44f to your computer and use it in GitHub Desktop.
Save antojoseph/237a6fce5c016a70faf0b3495de4a44f to your computer and use it in GitHub Desktop.
Burp Extender - Python Scripter Plug-in to send responses to a docker container for further processing ( decryption/encoding/analysis )
import sys
import re
import urllib2
import base64
print(sys.version)
print(sys.path)
pattern = r"content-type:.application/json"
if not messageIsRequest:
response = messageInfo.getResponse()
foundmatches = re.finditer(pattern, response.tostring(), re.MULTILINE | re.IGNORECASE)
if(foundmatches):
bodyStart=helpers.analyzeResponse(response).getBodyOffset()
print(response.tostring()[bodyStart:])
print("\r\n##end of response##\r\n")
url = 'http://127.0.0.1:5000/decode'
encoded = base64.b64encode('response.tostring()[bodyStart:])
req = urllib2.Request(url,encoded)
post = urllib2.urlopen(req)
print(post.read())
@antojoseph
Copy link
Author

Screen Shot 2019-12-02 at 2 45 38 PM

@antojoseph
Copy link
Author

Screen Shot 2019-12-02 at 2 45 50 PM

@antojoseph
Copy link
Author

Add Jython support to burp suite , add Python Scripter plugin from BApp Store / Developer GitHub , Enable the extension, paste the code snippet from gist!
For each response that matches the content-type : application/json , burp suite will send the request body to the API endpoint at "url" and log the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment