Public
Snippet $6 authored by Christian Gerdes

Netcat examples

netcat.txt
# Test port connect (TCP SYN, ACK, FIN, FIN ACK)
nc -z -v <host> <ports>

# Test port connect and send data from stdin print output to stdout
nc <host> <port>

# Send data and print output to stdout
echo -e "HEAD / HTTP/1.0\r\nHost: www.test.se\r\n\r\n" | nc <host> <port>

# Send binary data and print output to stdout
nc <host> <port> < data.bin