This project was created by PortSwigger to help you quickly start developing extensions in Java.
- Before you start
- Writing your extension
- Building your extension
- Loading the JAR file into Burp
- Sharing your extension
Before you begin development, make sure that your project's JDK is set to version "21".
To begin development, open the Extension.java file. It includes an example of setting your extension's name, which you can customize with your own logic.
The template contains the following components for building your extension:
- The
initialize
method. This is the entry point for your extension. It is called when the extension is loaded and receives a montoyaApi argument, which provides access to all Montoya API features. - The
Extension
class. This implements the BurpExtension interface, so your extension is recognized and loaded by Burp.
- For more information on Montoya API features, see the JavaDoc.
- To explore example extensions, visit our GitHub repository.
- For more information on creating extensions, see our documentation.
- For a beginner tutorial, see Writing your first extension.
- If you have any questions or need help from the community, join our Discord channel.
You can use an LLM to help you write your extension. To support this, we've included a CLAUDE.md
file and supporting documentation that provide essential context for the model.
To use this file with Claude Code:
- Open a terminal and navigate to the
ExtensionTemplateProject
folder. - Run Claude Code using the following command:
claude
. - Prompt Claude to create some code for your extension.
Claude should automatically read the contents of the ExtensionTemplateProject
folder, including the CLAUDE.md
file, then create draft code for you to review. If you think it hasn't read the CLAUDE.md
file, directly prompt it to do so before continuing.
If you're using an LLM other than Claude Code, prompt the LLM to read the CLAUDE.md
file and supporting documentation from the docs
folder, or provide their contents as part of your context window.
When you're ready to test and use your extension, follow these steps to build a JAR file and load it into Burp.
To build the JAR file, run the following command in the root directory of this project:
- For UNIX-based systems:
./gradlew jar
- For Windows systems:
gradlew jar
If successful, the JAR file is saved to <project_root_directory>/build/libs/<project_name>.jar
. If the build fails, errors are shown in the console. By default, the project name is extension-template-project
. You can change this in the settings.gradle.kts file.
To load the JAR file into Burp:
- In Burp, go to Extensions > Installed.
- Click Add.
- Under Extension details, click Select file.
- Select the JAR file you just built, then click Open.
- [Optional] Under Standard output and Standard error, choose where to save output and error messages.
- Click Next. The extension is loaded into Burp.
- Review any messages displayed in the Output and Errors tabs.
- Click Close.
Your extension is loaded and listed in the Burp extensions table. You can test its behavior and make changes to the code as necessary.
If you make changes to the code, you must rebuild the JAR file and reload your extension in Burp for the changes to take effect.
To rebuild the JAR file, follow the steps for building the JAR file.
To quickly reload your extension in Burp:
- In Burp, go to Extensions > Installed.
- Hold
Ctrl
or⌘
, and select the Loaded checkbox next to your extension.
Once you've built your extension, we'd love to see what you've created!
Share your extension on our PortSwigger Discord #extensions channel to get feedback, showcase your work, and connect with other developers. Then take it to the next level by submitting your extension to the BApp store, making it available to the community of 80,000+ users worldwide.
For guidance on the submission process, see Submitting extensions to the BApp store.