Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. echo mycommand >/dev/tcp/127.0.0.1/1234
  2.  
  3. #!/bin/bash
  4. echo "HTTP/1.0 200 OK
  5. Content-Type: text/plain
  6.  
  7. running command" |
  8. sed 's/$/r/'
  9. if echo mycommand >/dev/tcp/127.0.0.1/1234
  10. then echo OK
  11. else echo fail
  12. fi
  13. date
  14.  
  15. socat tcp-listen:8001,reuseaddr,fork exec:/tmp/myscript
  16.  
  17. * Connected to localhost (127.0.0.1) port 8001 (#0)
  18. > GET / HTTP/1.1
  19. > Host: localhost:8001
  20. > User-Agent: curl/7.43.0
  21. > Accept: */*
  22. >
  23. * HTTP 1.0, assume close after body
  24. < HTTP/1.0 200 OK
  25. < Content-Type: text/plain
  26. <
  27. running command
  28. OK
  29. Wed Aug 23 21:04:47 CEST 2017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement