Burp Suite User Forum

Login to post

Get local path of burp file via API

Wyatt | Last updated: Dec 10, 2018 03:41PM UTC

I'm looking to be able to save information to the same directory as my Burp project file through a Burp Extension. I organize my project files in folders with respect to the applications I'm testing. There is the getCommandLineArguments method from callbacks, however I don't run Burp through the command line. I'd be fine doing this, but I'm not sure if I can load a project file this way. In an extension, I can use os.getpwd() in python to get the working directory of the extension. I don't generally keep my extensions in my project folders. I don't want to place an extension in every project directory. My need is for this to be dynamic. An API call would be preferred. I wasn't able to find an API call that met this need. Do other people write to files in their project directory?

PortSwigger Agent | Last updated: Dec 11, 2018 10:48AM UTC

There isn't currently an API to do this, although it's something we may add in future. You can load a project from the command like, using the --project-file switch. What some extensions do as a workaround is use addToSiteMap to add a page to the site map. This isn't a real page, rather something like http://extension-info/ This lets extensions save data inside the project file. For example, Response Clusterer was recently updated to have this functionality.

Burp User | Last updated: Dec 11, 2018 02:24PM UTC

I gave the project-file switch a try and did not get any results. I ran the jar like this: java -jar C:\path_to_jar\burpsuite.jar --project-file=C:\different_path_to_project\my_project.burp In the registerExtenderCallbacks method I have the following python code to look at the arguments: print "Arguments are" for i in callbacks.getCommandLineArguments(): print i print "Len of args is %d" % len(callbacks.getCommandLineArguments()) In the output I get: Arguments are Len of args is 0

Burp User | Last updated: Dec 11, 2018 02:30PM UTC

I'm not looking to save data to the project file. My goal is to be able to export data to be consumed by other tools. I suppose a temporary solution would be to add a settings configuration and manually add the path each time. Then I could run my functionality based on this setting.

PortSwigger Agent | Last updated: Dec 11, 2018 02:38PM UTC

Ok, getCommandLineArguments() returns the arguments after the Burp arguments have been parsed, so it won't help here. I think that temporary solution is the best for now. We are going to do a refactor of the Extender API in future. We'll let you know when we've added this feature.

Sally | Last updated: May 27, 2020 07:37PM UTC

Is there any way we can get the path of the currently opened Burp file? I would like to create a java extension where the file chooser opens the burp file location by default.

Sally | Last updated: May 27, 2020 07:38PM UTC

Location of burp project file, not the burp binary

Uthman, PortSwigger Agent | Last updated: May 28, 2020 09:12AM UTC

Have you looked into implementing JFileChooser? You should be able to set a specific directory when the File Explorer opens. - https://www.codota.com/code/java/methods/javax.swing.JFileChooser/setCurrentDirectory - http://www.fredosaurus.com/notes-java/GUI/containers/20dialogs/30filechooser.html The feature request to get the location of the project file via the API is still in our development backlog. We will notify this thread if and when the capability is added to the Extender API.

Sally | Last updated: May 28, 2020 10:22AM UTC

Hi there, yes I am aware of the method to set the directory - am just figuring how to retrieve the current burp project file location to pass into the set method. Is there any ETA since its been raised back in 2018?

Uthman, PortSwigger Agent | Last updated: May 28, 2020 10:36AM UTC

It has been flagged up to a product manager again so we will update this thread when the feature is implemented. The implementation of features is usually decided based on popularity and priority. Unfortunately, we have a large backlog of requests at the moment. Are all the project files going to be in the same directory? What does your workflow look like?

Sally | Last updated: May 28, 2020 02:11PM UTC

Yes that's correct! Pentesters create folders for different clients. Within each client, we create folders for each project containing all burp evidences (project files, intruder logs, certificates etc). The process would be streamlined if JFileChooser opens directly at the folder of the currently opened project, rather than at User Home or Desktop or Documents folder. The implementation should be very quick since Burp already has project location and just needs to expose to the API so we can use it :)

You need to Log in to post a reply. Or register here, for free.