Burp Suite User Forum

Create new post

How does saveBuffersToTempFiles() work?

wohclams | Last updated: Apr 29, 2021 03:07PM UTC

I'd like to save requests/responses to temp files as part of an extension and so I'm looking for a bit more info on how saveBuffersToTempFiles() works. It sounds like calling the method saves the IHttpRequestResponse object to a temp file. How am I then supposed to work with that temp file? Is the intention that I keep a reference to the returned IHttpRequestResponsePersisted and use that going forward to pull data from the temp file? Where is the temp file stored? Is it associated with the current project? If Burp is closed and relaunched, is there any way for me to access, or "load," that temp file again?

Hannah, PortSwigger Agent | Last updated: Apr 30, 2021 03:48PM UTC

Hi

Temporary files get deleted both on shutdown and startup of Burp. Therefore, if you close and relaunch Burp the temporary files will not be persisted.

If you'd like to save data to persist across reloads of Burp, then check out IBurpExtenderCallbacks.saveExtensionSetting() and IBurpExtenderCallbacks.loadExtensionSetting()

Alternatively, if there's an existing extension that has a method of persisting data in a similar way to how you would like to persist your data you could have a look at how they've done it. All BApp Store extensions have their code publicly available on GitHub. You can find them here

For persisting information on a project level basis, extension authors have had success creating a "dummy" site map item and using that to store information.

Please let us know if you need any further assistance.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.