This is an old revision of the document!
NC
General Information
nc or netcat “is a feature-packed networking utility which reads and writes data across networks from the command line.”.
Checklist
- Distro(s): Any
Useful Arguments
EL6
- -z → Scan only
- -v → verbose
- -w 3 → wait 3 seconds before timeout of initial connection
EL7
- -i → Idle read/write timeout (disconnect after successful connection)
- -v → verbose
- -w 3 → wait 3 seconds before timeout of initial connection
Examples
Netcat examples.
Test Port Reachability
Test to see if you can open a connection to a port on a remote system.
This is useful to see if a firewall has correct rules.
Example: Check the remote system (192.168.1.1) for an open 443/tcp connection
- EL6
nc -zvw 3 192.168.1.1 443
- EL7
nc -i 3 -vw 3 192.168.1.1 443