Burp Suite User Forum

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.

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