The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Callbacks method to get the BurpExtender instance

August | Last updated: Dec 12, 2016 07:51PM UTC

Is there a method in IBurpExtenderCallbacks or IExtensionHelpers to get the actual BurpExtender instance? If not, would you consider adding one?

PortSwigger Agent | Last updated: Dec 13, 2016 08:40AM UTC

By "the actual BurpExtender instance", I assume you mean the instance of your own extension. This is a class that you fully control. If you need to hold a reference to the instance of it, then store it somewhere when it is constructed, or pass a reference to the instance into any other locations that need it.

Burp User | Last updated: Dec 15, 2016 12:46AM UTC

That is essentially what I did: Created a singleton instance and then added a static getInstance() method to the BurpExtender class: private static BurpExtender instance = this; public static BurpExtender getInstance() { return instance; } Is this a safe approach to use? Does Burp ever construct more than one instance of an extension?

PortSwigger Agent | Last updated: Dec 15, 2016 08:53AM UTC

Burp won't construct more than one instance of an extension within the same classloader (extensions are each loaded in separate classloaders to prevent naming collisions). So the singleton is safe enough. But it's not obligatory, since it should be possible to pass the reference to your BurpExtender instance to any other component that will ever need to access it.

Burp User | Last updated: Dec 15, 2016 05:39PM UTC