Skip to content

Instantly share code, notes, and snippets.

@p-g-krish
Forked from antojoseph/ResponseProcessing.py
Created May 18, 2020 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p-g-krish/e70e01e2ff648e96738353dbb303164e to your computer and use it in GitHub Desktop.
Save p-g-krish/e70e01e2ff648e96738353dbb303164e 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())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment