Automatically spawn a reverse shell fully interactive for Linux or Windows victim

Go Report Card

Girsh (Golang Interactive Reverse SHell)

Who didn't get bored of manually typing the few lines to upgrade a reverse shell to a full interactive reverse shell (tty spawn, stty size ..., stty raw -echo) or typing the command to use ConPTY.

Description

With Girsh, just run it and it will detect the OS and execute the correct commands to upgrade it to a full interactive reverse shell.

For a Linux:

  • Get the terminal's size
  • Spawn a tty using python2.7, python3 and python
  • Change the terminal as raw

For a Windows:

  • Dowload ConPTY on the same machine and same port as the reverse shell server
  • Listen for getting the ConPTY reverse shell

Usage

Two modes are available:

Simple listener

go run main.go listener -h
Usage:
  girsh listen [flags]

Flags:
  -h, --help   help for listen

Global Flags:
  -d, --debug      Debug output
  -p, --port int   port to listen (default is 1234) (default 1234)

Interactive

go run main.go -h
Generate a reverseshell oneliners (credits shellerator).
        And listen then run stty raw -echo and send the python command to spawn a tty shell if it's Linux
        or use ConPTY if it's windows

Usage:
  girsh [flags]
  girsh [command]

Available Commands:
  help        Help about any command
  listen      Listen and spawn a fully interactive for windows and linux client

Flags:
  -d, --debug      Debug output
  -h, --help       help for revshell
  -p, --port int   port to listen (default is 1234) (default 1234)

Demo

Linux

Gif for linux victim

Windows

Comments
  • Need to wait a long time to get the session

    Need to wait a long time to get the session

    When I use Grish, I found that I need to wait a long time to get the session, I just read your source code and still don't know why, here is debug print, it seems that each time I need to wait 7 seconds and then run command whoami, and both sides is linux (centos / wsl subsystem ubuntu)

    image

  • New session connect breaks current session

    New session connect breaks current session

    Want to start out by saying this application is perfect for my use case. Thank you so much for spending your time and effort on this project.

    Using Tmux and zsh, when I am connected to one session and another reverse shell connects on the listening port the output breaks my connected session and no longer let's me input any keystrokes.

    If you need any more info I can send a screenshot and debug information.

    Thank you so much for your time!

  • Update golang.org/x/net commit hash to d418f37 - autoclosed

    Update golang.org/x/net commit hash to d418f37 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | 8d99171 -> d418f37 |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update golang.org/x/net commit hash to 8d99171

    Update golang.org/x/net commit hash to 8d99171

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | e898025 -> 8d99171 |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update wangyoucao577/go-release-action action to v1.20

    Update wangyoucao577/go-release-action action to v1.20

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | wangyoucao577/go-release-action | action | minor | v1.19 -> v1.20 |


    Release Notes

    wangyoucao577/go-release-action

    v1.20

    Compare Source

    • Always use latest go version by default;
    • Support 1.16 and 1.17 fields.

    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update golang.org/x/net commit hash to e898025

    Update golang.org/x/net commit hash to e898025

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | 60bc85c -> e898025 |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Dependency Dashboard

    Dependency Dashboard

    This issue provides visibility into Renovate updates and their statuses. Learn more

    This repository currently has no open or pending branches.


    • [ ] Check this box to trigger a request for Renovate to run again on this repository
  • Update golang.org/x/net commit hash to 60bc85c

    Update golang.org/x/net commit hash to 60bc85c

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | aaa1db6 -> 60bc85c |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update module golang.org/x/text to v0.3.7

    Update module golang.org/x/text to v0.3.7

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/text | require | patch | v0.3.6 -> v0.3.7 |


    Release Notes

    golang/text

    v0.3.7

    Compare Source


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update wangyoucao577/go-release-action action to v1.19

    Update wangyoucao577/go-release-action action to v1.19

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | wangyoucao577/go-release-action | action | minor | v1.18 -> v1.19 |


    Release Notes

    wangyoucao577/go-release-action

    v1.19

    Compare Source

    • Support make build command.

    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update golang.org/x/net commit hash to aaa1db6

    Update golang.org/x/net commit hash to aaa1db6

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | 853a461 -> aaa1db6 |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update module github.com/spf13/cobra to v1.3.0

    Update module github.com/spf13/cobra to v1.3.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/spf13/cobra | require | minor | v1.2.1 -> v1.3.0 |


    Release Notes

    spf13/cobra

    v1.3.0

    Compare Source

    v1.3.0 - The Fall 2021 release ๐Ÿ

    Completion fixes & enhancements ๐Ÿ’‡๐Ÿผ

    In v1.2.0, we introduced a new model for completions. Thanks to everyone for trying it, giving feedback, and providing numerous fixes! Continue to work with the new model as the old one (as noted in code comments) will be deprecated in a coming release.

    • DisableFlagParsing now triggers custom completions for flag names #โ€‹1161
    • Fixed unbound variables in bash completions causing edge case errors #โ€‹1321
    • help completion formatting improvements & fixes #โ€‹1444
    • All completions now follow the help example: short desc are now capitalized and removes extra spacing from long description #โ€‹1455
    • Typo fixes in bash & zsh completions #โ€‹1459
    • Fixed mixed tab/spaces indentation in completion scripts. Now just 4 spaces #โ€‹1473
    • Support for different bash completion options. Bash completions v2 supports descriptions and requires descriptions to be removed for menu-complete, menu-complete-backward and insert-completions. These descriptions are now purposefully removed in support of this model. #โ€‹1509
    • Fix for invalid shell completions when using ~/.cobra.yaml. Log message Using config file: ~/.cobra.yaml now printed to stderr #โ€‹1510
    • Removes unnecessary trailing spaces from completion command descriptions #โ€‹1520
    • Option to hid default completion command #โ€‹1541
    • Remove __complete command for programs without subcommands #โ€‹1563

    Generator changes โš™๏ธ

    Thanks to @โ€‹spf13 for providing a number of changes to the Cobra generator tool, streamlining it for new users!

    • The Cobra generator now won't automatically include Viper and cleans up a number of unused imports when not using Viper.
    • The Cobra generator's default license is now none
    • The Cobra generator now works with Go modules
    • Documentation to reflect these changes

    New Features โญ

    • License can be specified by their SPDX identifiers #โ€‹1159
    • MatchAll allows combining several PositionalArgs to work in concert. This now allows for enabling composing PositionalArgs #โ€‹896

    Bug Fixes ๐Ÿ›

    Testing ๐Ÿ‘€

    • Now testing golang 1.16.x and 1.17.x in CI #โ€‹1425
    • Fix for running diff test to ignore CR for windows #โ€‹949
    • Added helper functions and reduced code reproduction in args_test #โ€‹1426
    • Now using official golangci-lint github action #โ€‹1477

    Security ๐Ÿ”

    Documentation ๐Ÿ“

    • Multiple projects added to the projects_using_cobra.md file: #โ€‹1377 #โ€‹1501 #โ€‹1454
    • Removed ToC from main readme file as it is now automagically displayed by GitHub #โ€‹1429
    • Documentation correct for when the --author flag is specified #โ€‹1009
    • shell_completions.md has an easier to use snippet for copying and pasting shell completions #โ€‹1372

    Other ๐Ÿ’ญ

    Thank you to all our amazing contributors โญ๐Ÿ๐Ÿš€


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update golang.org/x/net commit hash to fe4d628

    Update golang.org/x/net commit hash to fe4d628

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang.org/x/net | require | digest | 8d99171 -> fe4d628 |


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • Update module github.com/manifoldco/promptui to v0.9.0

    Update module github.com/manifoldco/promptui to v0.9.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/manifoldco/promptui | require | minor | v0.8.0 -> v0.9.0 |


    Release Notes

    manifoldco/promptui

    v0.9.0

    Compare Source

    What's Changed

    New Contributors

    Full Changelog: https://github.com/manifoldco/promptui/compare/v0.8.0...v0.9.0


    Configuration

    ๐Ÿ“… Schedule: At any time (no schedule defined).

    ๐Ÿšฆ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    โ™ป Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    ๐Ÿ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

  • session is unstable

    session is unstable

    session often crashes with Read error:

    Screen Shot 2021-10-16 at 10 48 29

    my connection to the target may be poor because it is based on openvpn over udp, but could you improve unstable connection support, maybe by increase the read timeout or by adding a retry for reading from a socket?

Mount your podman container into WireGuard networks on spawn

wg-pod A tool to quickly join your podman container/pod into a WireGuard network. Explanation wg-pod wires up the tools ip,route,wg and podman. It cre

Aug 14, 2022
A pair of local reverse proxies (one in Windows, one in Linux) for Tailscale on WSL2

tailscale-wsl2 TL;DR Running two reverse proxies (one in Windows, one in the WSL2 Linux VM), the Windows Tailscale daemon can be accessed via WSL2: $

Dec 9, 2022
Golang Reverse Shell

goReverseShell First ever GO project aimed to learn GO basics. PoC of a GO reverse shell, not expected to be used in real conditions. Undetected by AV

Jul 21, 2022
Reverse Shell in Golang and PowerShell Fud (27/04/2022)

ShellPwnsh Spanish: Generador de Backdoor en Golang, usando Reverse Shell en PowerShell, con formato de variables en el codigo para Bypass de AMSI y c

Nov 9, 2022
Automatically update your Windows hosts file with the WSL2 VM IP address

Automatically update your Windows hosts file with the WSL2 VM IP address

Jan 9, 2023
OliveTin is a web interface for running Linux shell commands.
OliveTin is a web interface for running Linux shell commands.

OliveTin OliveTin is a web interface for running Linux shell commands. Some example use cases; Give controlled access to run shell commands to less te

Dec 29, 2022
Creates a linux group of users synced to your Google Workspace users and automatically imports their public SSH keys.
Creates a linux group of users synced to your Google Workspace users and automatically imports their public SSH keys.

Creates a linux group of users synced to your Google Workspace users and automatically imports their public SSH keys.

Jan 27, 2022
A simple Go library to toggle on and off pac(proxy auto configuration) for Windows, MacOS and Linux

pac pac is a simple Go library to toggle on and off pac(proxy auto configuration

Dec 26, 2021
The interactive web server
The interactive web server

The interactive web server. HTTPLabs let you inspect HTTP requests and forge responses. Install Golang go get github.com/gchaincl/httplab go install g

Dec 24, 2022
A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and the registry.

dn42regsrv A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and registry data. A public instance

Apr 21, 2022
Gmqtt is a flexible, high-performance MQTT broker library that fully implements the MQTT protocol V3.1.1 and V5 in golang

ไธญๆ–‡ๆ–‡ๆกฃ Gmqtt News: MQTT V5 is now supported. But due to those new features in v5, there area lots of breaking changes. If you have any migration problem

Jan 5, 2023
Prisma Client Go is an auto-generated and fully type-safe database client

Prisma Client Go Typesafe database access for Go Quickstart โ€ข Website โ€ข Docs โ€ข API reference โ€ข Blog โ€ข Slack โ€ข Twitter Prisma Client Go is an auto-gene

Jan 9, 2023
gqlgenc is a fully featured go gql client, powered by codegen

gqlgenc Note: โš ๏ธ This is a WIP, backward-compatibility cannot be guaranteed yet, use at your own risk gqlgenc is a fully featured go gql client, power

Sep 17, 2022
GoSNMP is an SNMP client library fully written in Go

GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv1, SNMPv2c or SNMPv3. Builds are tested against linux/amd64 and linux/386.

Jan 5, 2023
Fast Telegram client fully in go.

Telegram client, in Go. (MTProto API)

Jan 4, 2023
GoSNMP is an SNMP client library fully written in Go.

GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv1, SNMPv2c or SNMPv3. Builds are tested against linux/amd64 and linux/386.

Oct 28, 2021
DeSo is a blockchain built from the ground up to support a fully-featured social network

DeSo is a blockchain built from the ground up to support a fully-featured social network. Its architecture is similar to Bitcoin, only it supports complex social network data like profiles, posts, follows, creator coin transactions, and more.

Dec 22, 2022
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.

Project X Project X originates from XTLS protocol, provides a set of network tools such as Xray-core and Xray-flutter. License Mozilla Public License

Jan 7, 2023