Can someone provide some example code for stopping burp suite programmatically using exitSuite as a Burp extension?
In your main BurpExtender class, you will be passed an IBurpExtenderCallbacks object when registerExtenderCallbacks() is called. You can exit the suite by calling:
Passing true will prompt the user to confirm the shutdown; passing false will not.
Your code will need to hold a reference somewhere to the callbacks object, so that you can call into it later.
ant fires up an instance of BurpProxy by making a java -jar invocation
some automated tests run
from the test framework, I want to shutdown BurpProxy.
Calling the exitSuite method from outside of the invocation results in an NPE because it has no reference to the callback object. Is there a way to register it somehow so I can get access to it?
When Burp calls registerExtenderCallbacks() it will pass your extension a reference to the callbacks object. Your code will need to hold a reference somewhere to the callbacks object, so that you can call into it later. For example, you could store the reference in a field in your main extension class and retrieve it from there.