Git Product home page Git Product logo

redi's Introduction

redi

Automated redirector setup compatible with HTTP RATs (CobaltStrike Beacon, meterpreter, etc), and CobaltStrike DNS Beacon. The script can either set up nginx reverse proxy, or DNS proxy/forwarder using dnsmasq. If HTTPS was selected, it will automatically setup letsencrypt certbot and obtain valid letsencrypt SSL certificates for your redirector domain name, and start nginx using the generated configuration.

The reverse proxy method allows for setting up more than one redirector each with its own valid certificate all pointing to the same CobaltStrike HTTPS stager/listener even if CobaltStrike is using self-signed/untrusted certificate.

It is also possible to modify the nginx configuration generated by the script to add extra features. For instance, you can choose to proxy only the traffic that matches your CobaltStrike malleable c2 profile and serve a static page or a different proxy otherwise. The configuration modifies the user-agent header to add the original source IP so that you can see it directly in your CobaltStrike web logs (see picture below).

With some configuration tweaking you can even SSL offload beacon's HTTPS traffic to a teamserver's HTTP listener!.

Advantages

  • Auto SSL setup for HTTPS using letsencrypt certbot.
  • Auto nginx and dnsmasq configuration.
  • Access logs for HTTP redirector (default nginx logs).
  • Fine control over HTTP headers by customizing nginx configuration.
  • Allows for multiple valid HTTPS redirectors setup
  • Adds original source ip to user-agent header for easy tracking.
  • No port bending needed.
  • SSL offloading possible, so you can have SSL beacon delivered to a backend HTTP listener !! (needs special setup).

alt tag

How to use

git clone https://github.com/taherio/redi.git
cd redi
chmod u+x redi.sh
./redi.sh <redirector domain> <teamserver ip/domain> <http/https>

#alternatively for dns redirector
./redi.sh <teamserver ip> dns

Example For setting up HTTPS redirector with multiple domains

./redi.sh first.myredirector.ca,second.myredirector.ca,third.myredirector.ca myteamserver.com https

Example For setting up HTTPS redirector

./redi.sh myredirector.ca myteamserver.com https

Example For setting up DNS redirector

./redi.sh 192.0.0.1 dns

Sample of HTTPS config generated

server {
    listen 443 ssl;
    server_name myredirector.ca;

    ssl on;
    ssl_certificate 	/etc/letsencrypt/live/myredirector.ca/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/myredirector.ca/privkey.pem;

    location / {
        proxy_pass         https://myteamserver.com:443/;
        proxy_redirect     off;
        proxy_set_header   Host             $host;
        proxy_set_header   "User-Agent" "${http_user_agent} - Original IP ${remote_addr}";
    }
}

redi's People

Contributors

taherio 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.