Burp Suite User Forum

Login to post

Import old HTTP requests and responses into Sitemap

Emerson | Last updated: May 17, 2020 09:36PM UTC

Hello - Been looking around in the forums and it doesn't appear anyone has asked this yet. I am attempting to write an extension that parses a .har file, which is a file that contains HTTP Requests and Responses. I want to import those requests and their corresponding responses and populate the sitemap with those. I can't seem to find a way to do that without using the .buildHttpRequest and .makeHttpRequest methods of the helper and callbacks interfaces respectively. The problem with this is that that NEW requests as opposed to populating the sitemap with the requests and responses already present in the .har file. Is there any clear cut way that perhaps I am overlooking that someone might be able to recommend going about addressing my problem? Thanks!

Hannah, PortSwigger Agent | Last updated: May 18, 2020 07:56AM UTC

Could you use makeHttpRequest to generate the the IHttpRequestResponse item, then use setResponse to change the response of the item to be that of your .har file, and add that to the sitemap? If you can find an extension that has similar functionality to what you are looking for, all BApp Store extensions are publicly available on GitHub (https://github.com/PortSwigger). You could see how they have implemented this functionality.

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