Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exec 3<>/dev/tcp/hostname/port
- echo "request" 1>&3
- response="$(cat <&3)"
- $ nc -l localhost 3000
- $ nc localhost 3000
- #!/bin/bash
- coproc netcat -l localhost 3000
- while read -r cmd; do
- case "$cmd" in
- d) date ;;
- q) kill "$COPROC_PID"
- exit ;;
- *) echo "What?" ;;
- esac
- done <&${COPROC[0]} >&${COPROC[1]}
- q
- echo GET / HTTP/1.0 | nc 0 80
- HTTP/1.1 400 Bad Request
- Date: Thu, 12 Jan 2017 13:44:23 GMT
- Server: Apache/2.4.18 (Ubuntu)
- Content-Length: 311
- Connection: close
- Content-Type: text/html; charset=iso-8859-1
Add Comment
Please, Sign In to add comment