Giter Site home page Giter Site logo

copy-as-node-request's Introduction

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

copy-as-node-request's People

Contributors

jonluca avatar pajswigger avatar portswiggersupport avatar renovate-bot avatar rossja avatar uthmanportswigger avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.