-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathIntrudeTheIntruder.py
52 lines (41 loc) · 2.02 KB
/
IntrudeTheIntruder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from burp import IBurpExtender
from burp import IHttpListener
from burp import IInterceptedProxyMessage
from java.io import File
from java.nio.file import Paths, Files
from java.nio.charset import StandardCharsets
import time
class BurpExtender(IBurpExtender, IHttpListener):
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpers = callbacks.getHelpers()
callbacks.setExtensionName("Intruder The Intruder 1.1 ")
callbacks.registerHttpListener(self)
callbacks.issueAlert("Dump neatly from intruder to disk.")
def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo):
if not messageIsRequest and toolFlag == self._callbacks.TOOL_INTRUDER:
intercepted_response = self._helpers.bytesToString(messageInfo.getResponse()).split("\r\n\r\n", 1)[1]
self.saveResponseBody(intercepted_response)
def saveResponseBody(self, intercepted_response):
try:
extraction_file = "ITI_intercept_{}.iti".format(time.strftime("%d-%m-%Y"))
with open(extraction_file, "a") as file:
file.write(intercepted_response + "\n\n")
self._callbacks.printOutput("Response body saved to: {}".format(extraction_file))
except Exception as e:
self._callbacks.printError("Error saving response body: {}".format(e))
def getAuthor(self):
return "Munir Njiru"
def getExtensionDescription(self):
"""
Simple Burp Extension to Extract Data From Intruder Realtime for External Analysis.
Use Cases:
- Extracting JSON responses from Intruder for iterative analysis outside burp.
- Saving HTML responses for further investigation.
- Analyzing XML responses for vulnerabilities.
- Removing headers from responses as opposed to the default intruder export
- Dumping recursively data from API's in API testing
"""
def getExtensionName(self):
return "Intrude the Intruder 1.1"
callbacks = BurpExtender()