Hi
In order to perform an action based on an issue raised by the scanner (at the point where it gets raised), you would want to register an
AuditIssueHandler
in your main
initialize()
method. I'm not sure if this handler takes issue consolidation into account, so it's possible that you may end up with duplicates.
This will also only register new issues as they come in, so you may wish to implement some import functionality for previously discovered issues - you can retrieve these from the site map using
montoyaApi.siteMap().issues()
.
The
AuditIssueHandler
will receive details about issues raised, whereas an
HttpHandler
will only receive details about requests and responses passing through Burp.
A very basic example could look like this:
import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
import burp.api.montoya.scanner.audit.issues.AuditIssue;
import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("unused")
public class Extension implements BurpExtension
{
@Override
public void initialize(MontoyaApi montoyaApi)
{
List<AuditIssue> issueList = new ArrayList<>();
montoyaApi.scanner().registerAuditIssueHandler(issueList::add);
montoyaApi.userInterface().registerSuiteTab("My panel", new MyPanel(issueList));
}
}