Git Product home page Git Product logo

5l1v3r1 / target-redirector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bao7uo/target-redirector

0.0 1.0 0.0 1.26 MB

Target Redirector is a Burp Suite Extension written in Kotlin, which redirects all Burp requests destined for a chosen target to a different target of your choice. The hostname/IP, port and protocol (HTTP/HTTPS) can all be configured to an alternative destination.

Home Page: https://portswigger.net/bappstore/d938ed20acbe4cd9889aa06bd23ba7e1

License: Apache License 2.0

Kotlin 96.20% HTML 3.80%

target-redirector's Introduction

Target Redirector - A Burp Suite Extension

BApp Store Language License

Redirects requests from ALL Burp areas, not just the proxy

Target Redirector is a Burp Suite Extension written in Kotlin, which redirects all Burp requests destined for a chosen target to a different target of your choice. The hostname/IP, port and protocol (HTTP/HTTPS) can all be configured to an alternative destination. You can choose to leave the HTTP Host header intact or update it if necessary. Other HTTP headers and the body remain unaffected.

"the Redirector will save a bit of messing with routing and iptables" -- @ticarpi

Overview

Target Redirector screenshot

This plugin is useful in various situations where you want to force a particular target hostname/IP and/or port and/or protocol to be used. Features include:

  • redirect all (or specific) http connections to https or vice-versa
  • redirect connections destined for any (or specific) host and/or port to a different host and/or port
  • alter host header

Examples of use:

  • testing a staging/pre-production environment on a different host and/or port which insists on linking/redirecting you back to the production environment. you can add both environments to scope, and allow the scanner to scan all the referenced pages, but whilst ensuring that only the staging/pre-production targets are scanned
  • testing a web application which is protected by third-party DDOS protection/load balancers that present on the public URL. The third-party servers are not in scope so cannot be tested. A backend target IP/hostname has been provided, but the public URL is referenced all over the target web application
  • hostname resolving to multiple IP addresses, but you can only test one IP, and you do not want to the "fix" DNS using hosts file or similar
  • testing the unencrypted version of a site which is hosted as both TLS/SSL and unencrypted, but the unencrypted site links you back to the SSL one
  • as above, but the other way round. strangely enough I have encountered many web apps which like to downgrade from TLS/SSL to unencrypted

Build / Requirements

This project is written in Kotlin, although is currently built with the regular Java Burp API. Building from source requires the Kotlin compiler (tested with kotlinc-jvm 1.2.10).

To build, use the following command which has been tested successfully on both Windows and Linux.

  • kotlinc -classpath burp-extender-api-1.7.22.jar src/main/kotlin/target-redirector.kt -include-runtime -d target-redirector.jar

The project can be built against a Kotlin version of the Burp API. See the following page from my other repo which has further details about the Burp API and Kotlin.

To build with the Kotlin Burp API, place the API kt source files in the src/main/kotlin/burp directory and build with the following command.

  • kotlinc src/main/kotlin/burp/*.kt src/main/kotlin/target-redirector.kt -include-runtime -d target-redirector.jar

Usage

This extension is simple and intuitive. It will search ALL requests made by Burp or proxied by Burp for the hostname/port/protocol combination specified in the upper row. If all three connection detail criteria match for a request, the extension will replace the connection criteria with those specified in the lower row. Status updates are logged in the extension's stdout on Burp's Extender tab.

Demo

To test the extension, set the upper row hostname to pages.bao7uo.com with port 80 and HTTPS unticked. Set the lower row hostname to bao7uo.github.io with port 443 and HTTPS ticked. Leave the hostname option unticked, and click on the button to Activate redirection.

Then Proxy a browser through Burp to page http://pages.bao7uo.com/target-redirector_test.html

A check of the log in Burp extender's stdout for Target Redirector should show that the redirections are taking place, as shown in the screenshot below.

Target Redirector screenshot

A packet capture will confirm this is the case.

Target Redirector screenshot

Target Redirector Roadmap

This project is still under development.

Potential future improvements:

  • Improve UI
  • Source code optimisation

Potential future features:

  • Hostname resolution for invalid hostnames
  • Replacing port as well as hostname
  • Default host header
  • Custom host headers
  • Regex matching for host/port
  • Case insensitivity of hostname
  • Flexible HTTP/HTTPS options
  • Allow redirecting of any host/port
  • Allow destination host or port to remain unchanged
  • Comment/highlight redirected requests
  • Multiple search terms/redirections
  • Save settings
  • Session handling actions / Burp tool scope
  • History, monitoring, logging

Contribute

Contributions, feedback and ideas will be appreciated.

License notice

Copyright (C) 2016-2018 Paul Taylor

See LICENSE file for details.

target-redirector's People

Contributors

bao7uo avatar pajswigger avatar

Watchers

 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.