netcat (nc) is a utility for reading from and writing to network connections using TCP or UDP.
Syntax
netcat [options] host port
- -v
- Produce more verbose output.
- -z
- Only scan for listening daemons, without sending any data to them.
- -u
- Use UDP instead of TCP.
Test open port TCP
nc -z -v 192.168.0.1 1194
We we use nc
also to scan a range of ports
nc -z -v 192.168.0.1 80-1000
Test open port UDP
nc -z -v -u 192.168.0.1 1194