Burp extension to copy a request as a node.js requests function
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/burp
.gitignore
BappDescription.html
BappManifest.bmf
Burp-Extension.iml
README.md
build.gradle
burp-extension.properties
burp-extension.xml
burp-requests.jar
module_burp-extension.xml

README.md

Copy as Node.js Request

Burp extension to copy a request as a node.js requests function

Accessed via a Request -> Action -> Copy as Node.js Request

Installation

First save the interfaces from Burp Suite to the src/burp folder (should be .java files that begin with I...). These can be found in Burp Suite at Extender -> APIs -> Save Interface Files

Build the jar using ant, then install by navigating to Extender -> Extensions -> Add and select the jar

Please note the output should be saved in it's own folder, as it requires request to be in node_modules.

This can be installed with npm i request.

Sample

The output from the above screenshot would look like:

var request = require('request');

var burp0_cookie = '_ga=GA1.1.915896612.1504923897; _gid=GA1.1.331984532.1509395051; _gat=1'

var burp0_bodyString = "checked%5B%5D=1&checked%5B%5D=1&checked%5B%5D=1&checked%5B%5D=1&checked%5B%5D=1&checked%5B%5D=1"

var burp0_headers = {
    "Content-Length": "95", 
    "Accept": "*/*", 
    "Origin": "http://localhost:8070", 
    "X-Requested-With": "XMLHttpRequest", 
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36", 
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 
    "DNT": "1", 
    "Referer": "http://localhost:8070/", 
    "Accept-Encoding": "gzip, deflate, br", 
    "Accept-Language": "en-US,en;q=0.8,it;q=0.6", 
    "Connection": "close",
    'Cookie':burp0_cookie
}

var burp0_options = {
    url: "http://localhost:8070/RandomComic/rand",
    headers: burp0_headers,
    method:"post",
    body: dataString
}

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback)

Credits

Original inspiration by PortSwigger's python requests extension