BuffaloWill / burpsuite-project-file-parser

A Burp Suite Extension for parsing Project Files from the CLI.
84 stars 14 forks source link

Overview

burpsuite-project-file-parser is a Burp Suite extension to parse project files from the command line and output the results as JSON. It uses the Montoya Extender API so it should be cleanly compatible with most versions of Burp. Given a project file this can:

Blog Posts

Building an AppSec Pipeline with Burp Suite Data

8 Bug Hunting Exampes with burpsuite-project-parser

Installation

  1. Compile the code as described in Build Information
  2. Install the extension in Burp
  3. Make sure to set the Output and Errors to system console

Set console output

  1. Close Burp Suite and follow examples below to parse the project file.

Example Usage

Notes:

siteMap and proxyHistory

The siteMap and proxyHistory flags also support sub-components to speed up parsing. They are:

So, for example, to print out only the request body and headers from proxyHistory you would use:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
  proxyHistory.request.headers, proxyHistory.request.body

This massively speeds up parsing as the response bodies (which can be quite large) are ignored.

Print Audit items

Use the auditItems flag, for example:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
  auditItems 

Print site map and proxy history

Combine the siteMap and proxyHistory flags to dump out all requests/responses from the site map and proxy history:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
    siteMap proxyHistory 

Search Response Headers using Regex

Use the responseHeader=regex flag. For example to search for any nginx or Servlet in response header:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
    responseHeader='.*(Servlet|nginx).*'
...
{"url":"https://example.com/something.css","header":"x-powered-by: Servlet/3.0"}
{"url":"https://spocs.getpocket.com:443/spocs","header":"Server: nginx"}
...

Search Response Body using Regex

Note, searching through a response body is memory expensive. It is recommended to store requests/responses and search that.

Use the responseBody=regex flag. For example to search for <form elements in response bodies:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
    responseBody='.*<form.*'

If you want to clean up the results to something more manageable (rather than the entire response), YMMV with a second grep pattern for the 80 characters around the match:

java -jar -Djava.awt.headless=true [PATH_TO burpsuite_pro.jar] --project-file=[PATH TO PROJECT FILE] \
  responseBody='.*<form.*'| grep -o -P -- "url\":.{0,100}|.{0,80}<form.{0,80}"

Suggestions

Build Information

Option 1:

Run gradle fatJar from the root directory. This expects you have gradle and all dependencies installed.

Option 2:

Build the jar from the Dockerfile.

From the root directory of the project run:

mkdir build
docker build -t burpsuite-project-file-parser .
docker run --name burpsuite-project-file-parser -v [ADD THE FULLPATH TO YOUR CWD]/build:/tmp burpsuite-project-file-parser

The jar file should now be in the build directory of the project.