| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
⚠️ ARCHIVED PROJECT: This project is now archived because Python extensions are now natively supported by Burp Suite. This was the first implementation enabling Python extensions with Burp Suite, originally created in August 2010.
A Python binding for Burp Suite that allows you to write extensions in Python using the same IBurpExtender interface available in Java.
This extension leverages Jython (the Java implementation of Python) to bridge Python code with Burp Suite's Java-based extension API. The project consists of a Java wrapper (BurpExtender.java) that dynamically loads and executes Python extensions, making it possible to write Burp extensions in Python while maintaining full compatibility with the standard IBurpExtender interface.
If you've written Burp extensions in Java, you already know how to write them in Python - the interface is identical.
Created by David Robert in 2010, this was the first implementation of Python extension support for Burp Suite. Several security companies adopted this extension for their security testing workflows, and numerous tools (both internal and public) were built on top of this foundation. The success of this project demonstrated the value of Python extensibility and influenced Burp Suite's decision to implement native Python support.
Dynamically typed languages like Python are highly efficient for creating small, task-specific automation code quickly. Python's rich ecosystem of libraries and its interactive REPL make it ideal for web application security testing, where you often need to rapidly develop custom code tailored to specific applications or vulnerabilities.
burp-python/
├── burppython.jar # Compiled JAR containing Jython and Java wrapper
├── suite.bat / suite.sh # Launch scripts for Windows/Unix
├── Lib/ # Python extensions directory
│ └── BurpExtender.py # Your Python extension goes here
├── src/ # Java source code
│ ├── BurpExtender.java # Java wrapper that loads Python extensions
│ └── burp/ # Burp Suite API interfaces
│ ├── IBurpExtender.java
│ ├── IBurpExtenderCallbacks.java
│ ├── IHttpRequestResponse.java
│ ├── IMenuItemHandler.java
│ ├── IScanIssue.java
│ └── IScanQueueItem.java
└── examples/ # Example Python extensions
├── BurpExtender-minimal.py
├── BurpExtender-interactive.py
├── BurpExtender-menu.py
└── BurpExtender-w3af.py
Note: No separate Python or Jython installation is needed - everything is bundled in burppython.jar.
Create Lib/BurpExtender.py with this minimal example:
from burp import IBurpExtender
class BurpExtender(IBurpExtender):
def processProxyMessage(self, messageReference, messageIsRequest, remoteHost, remotePort,
serviceIsHttps, httpMethod, url, resourceType, statusCode,
responseContentType, message, interceptAction):
if not messageIsRequest:
# Simple string replacement in responses
message = message.tostring().replace("java", "python")
return messageThis simple extension intercepts all HTTP responses and replaces "java" with "python".
Run the launch script:
# Linux/Mac
./suite.sh
# Windows
suite.batWhen Burp Suite starts, you should see output confirming the Python extension loaded:
BurpExtender.py needs to be in a folder listed below: ['/path/to/burp-python/Lib', ...]
Your Python BurpExtender class can implement any of these methods from the IBurpExtender interface:
Note: You only need to implement the methods you actually use. The Java wrapper uses introspection to detect which methods are available and only delegates calls to implemented methods.
The examples/ folder contains four complete example extensions demonstrating different capabilities:
Purpose: Basic string replacement
Use Case: Learning the basic extension structure
Simple extension that replaces "java" with "python" in all HTTP responses. Great starting point for understanding the processProxyMessage method.
Purpose: Interactive Python REPL for message inspection
Use Case: Real-time debugging and analysis
Launches an interactive Python console when responses are intercepted (for in-scope URLs only), allowing you to:
Purpose: Custom context menu items
Use Case: Parameter comparison and analysis
Requires: Burp Suite Professional v1.3.07+
Adds a "python diff" menu item to compare GET and POST parameters between two selected requests. Demonstrates:
Purpose: Integration with w3af security framework
Use Case: Leveraging existing Python security tools
Integrates w3af (Web Application Attack and Audit Framework) plugins with Burp Suite, allowing you to:
See the examples/README.md for detailed documentation on each example.
Here's a complete example adding a parameter comparison menu item:
from burp import IBurpExtender, IMenuItemHandler
from cgi import parse_qs
class BurpExtender(IBurpExtender):
def registerExtenderCallbacks(self, callbacks):
self.mCallBacks = callbacks
# Register a custom menu item
self.mCallBacks.registerMenuItem("Compare parameters", ArgsDiffMenuItem())
class ArgsDiffMenuItem(IMenuItemHandler):
def menuItemClicked(self, menuItemCaption, messageInfo):
print "--- Parameter Comparison ---"
if len(messageInfo) == 2:
request1 = HttpRequest(messageInfo[0].getRequest())
request2 = HttpRequest(messageInfo[1].getRequest())
print "Diff in GET parameters:"
self.diff(request1.query_params, request2.query_params)
print "Diff in POST parameters:"
self.diff(request1.body_params, request2.body_params)
else:
print "You need to select two messages to do a comparison"
print "\n\n"
def diff(self, params1, params2):
for param in params1:
if param not in params2:
print "Param %s=%s is missing in second request" % (param, params1[param])
elif params1[param] != params2[param]:
print "Request1 %s=%s | Request2 %s=%s" % \
(param, params1[param], param, params2[param])
for param in params2:
if param not in params1:
print "Param %s=%s is missing in first request" % (param, params2[param])When you implement registerExtenderCallbacks(callbacks), you receive a callbacks object with these methods:
HTTP messages are passed as byte[] arrays. Convert to strings using:
message_string = message.tostring()To return modified messages, convert back to bytes or return as string (Jython handles conversion).
The launch scripts (suite.sh and suite.bat) configure the classpath and start Burp Suite:
Linux/Mac (suite.sh):
java -Xmx512m -classpath burpsuite_v1.3.03.jar:burppython.jar burp.StartBurpWindows (suite.bat):
java -Xmx512m -classpath burpsuite_v1.3.03.jar;burppython.jar burp.StartBurpImportant: Update the JAR filename to match your Burp Suite version.
The -Xmx512m flag allocates 512MB of heap memory. Increase this for larger workloads:
java -Xmx1024m -classpath burpsuite_v1.3.03.jar:burppython.jar burp.StartBurpCheck the terminal output when Burp Suite starts. You should see:
BurpExtender.py needs to be in a folder listed below:
If you see import errors, verify:
The Java wrapper uses Python introspection to detect available methods. If your method isn't being called:
Jython has limited compatibility with CPython libraries. If you encounter import errors:
Created: August 30, 2010
Author: David Robert (castlebbs)
Original Blog: http://blog.ombrepixel.com/ (Discontinued)
This project was developed when Burp Suite had no official Python support. It demonstrated the feasibility and value of Python extensions, which eventually influenced PortSwigger's decision to add native Python support to Burp Suite.
Several security companies adopted this extension for their testing workflows, and it served as the foundation for numerous custom security tools. The project represents an important milestone in the evolution of Burp Suite's extensibility.
This code is provided for use with Burp Suite and Burp Suite Professional, subject to the license terms for those products. The Burp Suite API interfaces (src/burp/*.java) are copyright PortSwigger Ltd.
Author: David Robert
Email: david@ombrepixel.com
⚠️ Important: For new projects, use Burp Suite's native Python extension support instead of this project. This repository is maintained for historical reference and legacy purposes only.
Modern Burp Suite versions include:
While this project is now archived, contributions for documentation improvements or historical accuracy are welcome. Please note that no new features will be added, as this project has been superseded by Burp Suite's native Python support.
Archived Project Notice: This repository is maintained for historical purposes and as a reference implementation. For active development, please use Burp Suite's native Python extension capabilities.
| Back | FazBrowse Home | New Git URL |