Guest User

Untitled

a guest
Nov 18th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. exec 3<>/dev/tcp/hostname/port
  2. echo "request" 1>&3
  3. response="$(cat <&3)"
  4.  
  5. $ nc -l localhost 3000
  6.  
  7. $ nc localhost 3000
  8.  
  9. #!/bin/bash
  10.  
  11. coproc netcat -l localhost 3000
  12.  
  13. while read -r cmd; do
  14. case "$cmd" in
  15. d) date ;;
  16. q) kill "$COPROC_PID"
  17. exit ;;
  18. *) echo "What?" ;;
  19. esac
  20. done <&${COPROC[0]} >&${COPROC[1]}
  21.  
  22. q
  23.  
  24. echo GET / HTTP/1.0 | nc 0 80
  25. HTTP/1.1 400 Bad Request
  26. Date: Thu, 12 Jan 2017 13:44:23 GMT
  27. Server: Apache/2.4.18 (Ubuntu)
  28. Content-Length: 311
  29. Connection: close
  30. Content-Type: text/html; charset=iso-8859-1
Add Comment
Please, Sign In to add comment