Last active
October 17, 2017 22:22
-
-
Save slugbyte/88a1e1290481ea69ba2beebf2ce56bcd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require('net').createServer((socket) => { | |
let bash = require('child_process').spawn('/bin/bash') | |
socket.on('data', data => bash.stdin.write(data.toString().trim() + '\n')) | |
bash.stdout.pipe(socket) | |
bash.stderr.pipe(socket) | |
}).listen(6666) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment