ProfessionalCommunity Edition
Setting up your extension development environment using the starter project
-
Last updated: February 13, 2025
-
Read time: 2 Minutes
The starter project simplifies extension development using the Montoya API. Instead of setting up your development environment manually, you can download the ready-to-use template, open it in an IDE, and start coding immediately.
Prerequisites
Before you begin, download a Java Integrated Development Environment (IDE). An IDE provides features like auto-completion and syntax highlighting to help streamline development.
We recommend using IntelliJ IDEA (Community Edition), a free Java IDE.
Step 1: Download the template
To download the starter project:
In Burp, go to Extensions > APIs.
Click Download starter project.
Choose a location, then click Save.
The project is saved in a folder called ExtensionTemplateProject
.
Step 2: Open the project
To open the project:
-
Open the
ExtensionTemplateProject
folder that you just saved in your IDE. -
If prompted, follow any set up instructions. This may not be necessary as many IDEs automatically detect Gradle and configure the project.
-
Set the project Java Development Kit (JDK) to version 21. This is required for compatibility with the latest Montoya API.
[Optional] Step 3: Rename the project
To rename the project:
Open
settings.gradle.kts
.Change
rootProject.name = "extension-template-project"
to your preferred name.Sync the Gradle changes.
Step 4: Start coding
To start coding:
Open
Extension.java
.In the
initialize
method, changeMy Extension
to your desired name. The name appears in Burp under Extensions > Installed when the extension loads.Add your custom code below this line.
Understanding the starter project
The project includes configuration and source files to help with extension development. The key file is Extension.java
, where you implement your extension's functionality. This section breaks down its key components.
import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
public class Extension implements BurpExtension
{
@Override
public void initialize(MontoyaApi montoyaApi) {
montoyaApi.extension().setName("My Extension");
// Add your code here
}
}
The file contains the following essential components:
Imports
import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
These imports bring in two classes from the Montoya API, enabling your extension to communicate with Burp:
BurpExtension
- Allows Burp to recognize your extension.MontoyaApi
- Gives access to Burp's features.
Main class
public class Extension implements BurpExtension
This defines the Extension
class. It implements BurpExtension
, which tells Burp this file contains an extension that it should load.
Initialize method
@Override
public void initialize(MontoyaApi montoyaApi) {
montoyaApi.extension().setName("My Extension");
// Add your code here
}
This method runs when Burp loads your extension. The montoyaApi
argument provides access to Burp's functionality.
The line setName("My Extension")
sets the name of your extension, as it appears in Burp's Extensions > Installed tab.
The @Override
annotation ensures that initialize
correctly implements the BurpExtension
interface. This means that if you accidentally use an incorrect method name or argument, Java gives an error instead of failing silently.