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:

  1. In Burp, go to Extensions > APIs.

  2. Click Download starter project.

  3. Choose a location, then click Save.

The project is saved in a folder called ExtensionTemplateProject.

Step 2: Open the project

To open the project:

  1. Open the ExtensionTemplateProject folder that you just saved in your IDE.

  2. If prompted, follow any set up instructions. This may not be necessary as many IDEs automatically detect Gradle and configure the project.

  3. 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:

  1. Open settings.gradle.kts.

  2. Change rootProject.name = "extension-template-project" to your preferred name.

  3. Sync the Gradle changes.

Step 4: Start coding

To start coding:

  1. Open Extension.java.

  2. In the initialize method, change My Extension to your desired name. The name appears in Burp under Extensions > Installed when the extension loads.

  3. 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.

Was this article helpful?