Git Product home page Git Product logo

redirect-lib's Introduction

C&C Redirectors Library

Library of command and control traffic redirectors, used in redteam engagements.

This project aim to gather methods to redirect traffic (HTTP/S, DNS) to another server. This capability is usefull to hide a server IP and bring flexibility. If the redirector is identified and blocked by defenders, a new one can be setup more easily than a full C&C server.

Having multiple methods enable the redteam to gain flexibility, adapt to different situation and better emulate real adversary.

Each documented redirection method is in a dedicated directory.

Categories

Redirectors has following attributes:

Attribute Description Possible values
Type Is it a smart or dumb redirector ? Is it able to apply conditionnal filtering/redirection rules ? smart, dumb
Subtype Give more details on the redirector command line, web server, function, service to configure, etc.
Automated Is the deployement process automated ? yes, no
Keep Origin IP Does the redirecter keep in any way the client IP and is able to tranfer it to the C2 ? yes, no
Decrypt Does the redirector needs to decrypt the trafic and thus exposing data to the provider ? yes, no

Automation

Automated solution make use of terraform and ansible when needed and possible.

Ansible config suppose you use root or a user able to become root.

Terraform

To deploy a redirector, cd in the terraform directory corresponding to the desire method and then:

terraform init
cp templates.tfvars my_redirector.tfvars

# Edit my_redirector.tfvars

terraform apply --var-file my_redirector.tfvars

Automation is done (when it is) to host the redirector on AWS (for redirector type such as web server or command line).

๐Ÿ’ฐ Pricing ๐Ÿ’ฐ

One of the goal of this project is to find cheap solutions. Feel free to propose any improvment to reduce the cost of a solution. Average cost of solutions are around 5$/month. Nonetheless, as price may vary no cost estimation is done per solution.

โš ๏ธ Be carefull with solution with a "pay per request" pricing. As you may use your redirector heavily at some point (ex. Cobalt Strike in interactive mode), cost can rise rapidly.

Tips : Doing 4 requests per second, during a month will result in 10 368 000 request per month.

If you don't need much, you may even stay under the "Free Tier" or "developper" offers threshold and not pay anything.

Comments

Some global recommendations/comments:

  • As you may notice, cloud instance choosen in automation are the smallest ones. You only need to redirect HTTP/S requests. If you find cheapest/smallest solutions, feel free to open an issue.

Status

Method Documented Ansible Terraform
socat โœ… โœ… โœ…
ssh โœ… โœ… โœ…
iptables โœ… โœ… โœ…
apache โœ… โœ… โœ…
nginx โœ… โœ… โœ…
haproxy โœ… โœ… โœ…
traefik โœ… โœ… โœ…
cloudflare-workers โœ… N/A โœ…
azure-cdn โœ… N/A โœ…
aws-cloudfront โœ… N/A โœ…
azure-functions โŒ N/A โŒ
cloudflare-cdn โŒ N/A โŒ
azure-functions โŒ N/A โŒ
google-cloud-functions โŒ N/A โŒ
aws-lambda โŒ N/A โŒ
go-proxy โŒ โŒ โŒ

Ideas / Possible candidates for integration

Here is the following ideas/candidates I have not yet explore:

Resources

redirect-lib's People

Contributors

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