https://github.com/jonluca/burp-copy-as-node
Burp extension to copy a request as a node.js requests function
https://github.com/jonluca/burp-copy-as-node
Last synced: about 1 year ago
JSON representation
Burp extension to copy a request as a node.js requests function
- Host: GitHub
- URL: https://github.com/jonluca/burp-copy-as-node
- Owner: jonluca
- Created: 2017-10-30T20:48:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T12:12:53.000Z (about 5 years ago)
- Last Synced: 2025-03-29T12:22:20.356Z (about 1 year ago)
- Language: Java
- Size: 115 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-burp-suite - **1**星
README
# 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:
```$xslt
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](https://github.com/PortSwigger/copy-as-python-requests)