Last active
November 22, 2020 15:17
-
-
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 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | |
Author
antojoseph
commented
Dec 2, 2019
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