⚠️ 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
- Java Wrapper: BurpExtender.javaacts as a bridge, implementing the Burp SuiteIBurpExtenderinterface in Java
- Jython Integration: The wrapper initializes a Jython interpreter and loads BurpExtender.pyfrom theLibfolder
- Dynamic Introspection: The Java wrapper uses Python introspection to detect which methods the Python extension implements
- Method Delegation: When Burp Suite calls extension methods, the Java wrapper delegates these calls to the corresponding Python methods
- Transparent Operation: From Burp Suite's perspective, it's loading a standard Java extension; from the developer's perspective, they're writing pure Python
- Write Burp Suite extensions in Python instead of Java
- Use the same IBurpExtenderinterface you're familiar with from Java
- Embed an interactive Python interpreter for real-time message inspection and manipulation
- Add custom menu items to Burp Suite's contextual menus
- Access to all Burp Suite callback functions (IBurpExtenderCallbacks)
- Partial implementation support - only implement the methods you need
- Full access to Python's standard library and any compatible Jython libraries
- Burp Suite (Free or Professional version)
- Professional version required for some features (e.g. custom menu items (minimum v1.3.07))
 
- burppython.jar (includes embedded Jython interpreter)
- Java Runtime Environment (compatible with your Burp Suite version)
Note: No separate Python or Jython installation is needed - everything is bundled in burppython.jar.
- Clone or download this repository to a dedicated folder
- Copy your Burp Suite JAR file into the project root folder
- Example: burpsuite_pro_v1.3.07.jarorburpsuite_v1.3.03.jar
 
- Example: 
- Update the launch script to match your Burp Suite JAR filename:
- Edit suite.sh(Linux/Mac) orsuite.bat(Windows)
- Change burpsuite_v1.3.03.jarto your actual filename
 
- Edit 
- Place your Python extension in the Libsubfolder:- Your extension must be named BurpExtender.py
- See examples/folder for templates
 
- Your extension must be named 
- Launch Burp Suite using the appropriate script:
- Linux/Mac: ./suite.sh
- Windows: suite.bat
 
- Linux/Mac: 
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:
- processProxyMessage(...)- Intercept and modify HTTP messages passing through Burp Proxy
- processHttpMessage(toolName, messageIsRequest, messageInfo)- Process HTTP messages from any Burp tool
- registerExtenderCallbacks(callbacks)- Receive callback object to interact with Burp Suite
- newScanIssue(issue)- Receive notifications when Scanner finds new issues
- setCommandLineArgs(args)- Receive command-line arguments passed to Burp Suite
- applicationClosing()- Perform cleanup when Burp Suite is closing
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:
- Inspect all method parameters interactively
- Modify messages in real-time using Python REPL
- Test transformations before committing them to code
- Access pprintfor pretty-printing data structures
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:
- Registering custom menu items
- Implementing IMenuItemHandler
- Parsing HTTP requests and extracting parameters
- Comparing request structures
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:
- Use w3af's grep plugins to analyze responses
- Apply w3af's evasion plugins to requests
- Combine Burp Suite's proxy capabilities with w3af's vulnerability detection
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:
- makeHttpRequest(host, port, useHttps, request)- Issue arbitrary HTTP requests
- sendToRepeater(host, port, useHttps, request, tabCaption)- Send requests to Repeater tool
- sendToIntruder(host, port, useHttps, request)- Send requests to Intruder tool
- sendToSpider(url)- Add URLs to Spider queue
- doActiveScan(host, port, useHttps, request)- Perform active vulnerability scans
- isInScope(url)- Check if URL is in current scope
- registerMenuItem(caption, handler)- Register custom context menu items
- getHeaders(message)- Extract headers from HTTP message
- getBody(message)- Extract body from HTTP message
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.StartBurp- Configure scope in Burp Suite's Target > Scope tab
- Use callbacks.isInScope(url)to respect scope settings in your extensions
- This prevents your extension from processing every intercepted message
- Python printstatements output to the terminal where you launched Burp Suite
- Use pprintfor pretty-printing complex data structures
- The interactive console example (BurpExtender-interactive.py) is excellent for debugging
- Start with BurpExtender-minimal.pyas a template
- Implement only the methods you need
- Test incrementally using print statements
- Use the interactive console for rapid prototyping
- Restart Burp Suite to reload modified extensions
- Extension must be named BurpExtender.pyand located in theLibfolder
- The class must be named BurpExtenderand implementIBurpExtender
- Python 2 syntax (this was created in 2010, uses Jython 2.x)
- Modifications require restarting Burp Suite (no hot reload)
Check 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:
- BurpExtender.pyis in the- Libfolder
- The file is named exactly BurpExtender.py(case-sensitive)
- The class is named BurpExtender
The Java wrapper uses Python introspection to detect available methods. If your method isn't being called:
- Verify the method signature matches the IBurpExtenderinterface exactly
- Check for typos in the method name
- Ensure proper indentation (Python requirement)
Jython has limited compatibility with CPython libraries. If you encounter import errors:
- Use Java libraries instead (accessible via Jython)
- Check Jython compatibility of the Python library
- Consider bundling pure-Python libraries in the Libfolder
- Jython 2.x: Uses Python 2 syntax (not Python 3)
- Single Extension: Only one BurpExtender.pycan be loaded at a time
- No Hot Reload: Modifications require restarting Burp Suite
- Library Compatibility: Limited to Jython-compatible libraries
- Performance: Slight overhead from Java-Python bridge
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:
- Native Python 3 support
- Better performance and integration
- Extensive official documentation
- Active maintenance and updates
- Support for multiple extensions simultaneously
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.