Netcat is a utility for checking open ports. It has more flexibility than using the telnet command and can be used with scripts more easily. This is not a comprehensive tutorial, only a quick reference source. Consult the man pages and/or documentation for indepth explanation of commands.
nc -v www.google.com 80 # success Ncat: Version 6.40 ( http://nmap.org/ncat ) Ncat: Connected to 126.96.36.199:80.
UDP tests will always appear successful. You need to run tcp dump and/or check firewall sessions to confirm UDP ports.
nc -vu 188.8.131.52 53 # success ... maybe ? Check firewall sessions if dont have access to end host for TCPDUMP Ncat: Version 6.40 ( http://nmap.org/ncat ) Ncat: Connected to 184.108.40.206:53.
It's possible to start a 'listener'. This is great for testing through firewalls.
# TCP sudo nc -l 10.1.1.10 80 # UDP sudo nc -l 10.1.1.10 -u 53
Last Updated: 2017-09-27