ProfessionalCommunity Edition
Filtering the site map with Bambdas
-
Last updated: December 19, 2024
-
Read time: 3 Minutes
You can apply Java-based Bambdas to create powerful custom filters for your site map. You can do this in two ways:
-
Load existing Bambdas - Load Bambdas from your Bambda library.
-
Create new Bambdas - Write and apply Bambdas directly in the Site map filter window.
Related pages
- For more information on how to manage your Bambdas, see Managing Bambdas in your Bambda library.
- For more information on how to add Bambdas to your library for use across Burp, see Importing Bambdas into your Bambda library.
Keyboard shortcuts
To speed up your workflow when creating or loading Bambdas, you can use the following keyboard shortcuts:
Save -
Ctrl + S
orCmd + S
Save as -
Ctrl + Shift + S
orCmd + Shift + S
Create new Bambda -
Ctrl + N
orCmd + N
Load recent Bambda -
Ctrl + O
orCmd + O
Loading Bambdas from your library
You can load and apply Bambdas that are stored in your library to filter your site map.
To load a Bambda from your library:
-
In Target > Site map, click the filter bar to open the Site map filter window.
-
In the Site map filter window, click Bambda mode.
-
Click Load.
-
Select a recent Bambda from the list.
-
[Optional] If required, edit the Bambda:
Make your changes.
Click Apply to compile and test the Bambda. Fix any errors shown in the Compilation errors panel. For more information, see Troubleshooting Bambdas.
-
Save your changes:
To overwrite the existing Bambda, click Save > Save.
To save a new version, click Save > Save as.
Click Apply & close.
Burp compiles your Bambda and applies it to every item already logged in your site map, and to any future site map items generated in this project.
Creating custom Bambdas
You can write your own Bambdas directly in the Site map filter window.
Note
Before you begin writing, we recommend exploring our Bambdas GitHub repository. There may be an existing Bambda that meets your needs or provides inspiration for creating your own.
Converting filter settings to Bambdas
You can convert filter settings to a Bambda as a starting point for further customization:
-
In Target > Site map, click the filter bar to open the Site map filter window.
Make changes to the filter settings as necessary.
At the bottom of the Site map filter window, click Convert to Bambda.
Your filter is converted into a Bambda, enabling you to customize it further using Java.
Note
Some filter settings can't be converted to Bambdas as they aren't currently supported. For example, these site map filter settings don't convert to Bambda mode:
-
Show only requested items
-
Hide not-found items
Creating your Bambda
Two objects of the Montoya API are available to help you write your Bambda:
SiteMapNode
Utilities
To create a Bambda to filter your site map:
-
In Target > Site map, click the filter bar to open the Site map filter window.
-
In the Site map filter window, click Bambda mode.
-
Write your Bambda using Java.
-
Click Apply to compile and test the Bambda. Fix any errors shown in the Compilation errors panel. For more information, see Troubleshooting Bambdas.
-
[Optional] Click Save > Save. The Bambda is saved to your Bambda library for future use across Burp.
-
Click Apply & close.
Burp compiles your Bambda and applies it to every item already logged in your site map, and to any future site map items generated in this project.
Warning
Using slow running or resource-intensive Bambdas can slow down Burp. Write your Bambda carefully to minimize performance impact.
Example Bambda
In the example below, we'll create a Bambda that filters the site map to show only items that meet the following criteria:
-
The item must have a
POST
method. -
The item must have an issue reported against it.
In this example, our Bambda is:
return node.requestResponse().request().method().equals("POST") && !node.issues().isEmpty();
Related pages
- To get feedback, showcase your work, and connect with other Bambda developers, share your Bambda on our PortSwigger Discord #bambdas channel.
- To share your Bambdas with the community, add them to our ever-growing Bambdas GitHub repository. For more information, see Submitting Bambdas to our GitHub repository.