You can use Java-based Bambdas to add powerful custom columns to the WebSockets history table. Custom columns enable you to see more detail about the items in your WebSockets history for a more focused analysis.
You can apply custom column Bambdas in two ways:
Load existing Bambdas - Load Bambdas from your Bambda library.
Create new Bambdas - Write and apply Bambdas directly in the Add custom column window.
To speed up your workflow when creating or loading Bambdas, you can use the following keyboard shortcuts:
Save - Ctrl + S or Cmd + S
Save as - Ctrl + Shift + S or Cmd + Shift + S
Create new Bambda - Ctrl + N or Cmd + N
Load recent Bambda - Ctrl + O or Cmd + O
You can load and apply Bambdas that are stored in your library to add custom columns to the WebSockets history table.
To load a Bambda from your library:
In Proxy > WebSockets history, click the options menu > Add custom column. The Add custom column window opens.
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.
Enter a name for your column in the Column header field.
Click Apply & close.
You can write your own Bambdas directly in the Add custom column window.
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.
Two objects of the Montoya API are available to help you write your Bambda:
ProxyWebSocketMessage
Utilities
To create a custom column for your WebSockets history table:
In Proxy > WebSockets history, click the options menu > Add custom column. The Add custom column window opens.
Enter a name for your column in the Column header field.
Write a Bambda using Java to specify the data that the custom column displays.
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.
Using slow running or resource-intensive Bambdas can slow down Burp. Write your Bambda carefully to minimize performance impact.
In the example below, we'll write a Bambda to create a custom column containing the session ID of the response.
Pattern pattern = Pattern.compile("\"sid\":\"(\\w.*)\"");
Matcher matcher = pattern.matcher(message.payload().toString());
matcher.find();
if (matcher.hasMatch())
{
return matcher.group(1);
}
return "";