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

ISessionHandling - detect if proxy is clicked in the tools scope (programmitacally) - Java

NazarMedeiros | Last updated: Oct 27, 2016 07:10AM UTC

Hello, I would like to know, if there is a solution for detecting, if the checkmark is clicked on "Proxy (use with caution)" in the session handling rule editor (programatically) ? I am using the ISessionHandling interface to manipulate some requests and I have one method which should be only called, when the checkmark is clicked (something like isProxyActive...). I also would like to know, how I can detect if my session handling rule is unclicked? When the peformAction() - method is not called anymore, I have to know that to call another specific method. Thanks in advance! Best regards, Nazar

PortSwigger Agent | Last updated: Oct 28, 2016 03:46PM UTC

You can access any of Burp's project-level configuration in the same JSON format that is used for configuration files, using this API: https://portswigger.net/burp/extender/api/burp/IBurpExtenderCallbacks.html#saveConfigAsJson(java.lang.String...) You can then inspect the JSON representation of the config to determine any particular setting that your extension needs to know about.

Burp User | Last updated: Oct 31, 2016 08:15AM UTC

I tried to call "callbacks.saveConfigAsJson(java.lang.String..)" but there is no function with this name. I can use "callbacks.saveConfig()" instead, but this should be deprecated according to the documentation. I am using the burpsuite_free_v1.7.06.jar. Mr. Stuttard is it possible that I can use something like an event-listener for my problem? Everytime I click on "Proxy (use with caution) " in the session handling rule editor, this should trigger an event. Of course it is possible to read the config file, but this would be mean that I have to save the file every time I select or deselect the proxy checkbox. According to your answer there should be something like this or not? Because the config file includes different settings when I save the file while the checkbox is checked or unchecked. Best regards, Nazar

PortSwigger Agent | Last updated: Oct 31, 2016 08:46AM UTC

Sure, the API I mentioned is there. Look in Extender / APIs. If you have an old copy of the interface files, you will need to save the current versions from that tab in Burp.

Burp User | Last updated: Oct 31, 2016 09:41AM UTC

Yes, I used old interface files..thanks. So I tried this out with the following code: "callbacks.saveConfigAsJson("/root/Desktop/");" which hasn't created a file. Then I tried this one: "callbacks.saveConfigAsJson("/root/Desktop/config.json");" no result either..no file created. What is my mistake? There is also a problem. In case I create the file and I want to load it to the java program. The return type of callbacks.loadConfigFromJson(String config) is "void". How I can inspect this then? And maybe one more time.. There is no other way that I could use, for checking if the checkbox is clicked or not? No event-listeners? Can I find out where the request comes from (toolflag) within the performAction-Method? Or do toolflags only work with the processHttpMessage-method? I really really need your help. Best regards, Nazar

PortSwigger Agent | Last updated: Oct 31, 2016 09:59AM UTC

Please read the API documentation. The methods don't save a file. They return a string containing the configuration.

Burp User | Last updated: Oct 31, 2016 10:13AM UTC