published: 27th of September 2017
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 220.127.116.11:80.
UDP tests will always appear successful. You need to run tcp dump and/or check firewall sessions to confirm UDP ports.
nc -vu 18.104.22.168 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 22.214.171.124: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