netcat
10 commands
10 shown
Listen on port
Start a netcat listener on port 4444
nc -lvp 4444
Connect to host
Open a TCP connection to host on port 80
nc 192.168.1.1 80
Port scanning
Scan ports 20-80 on a host (zero I/O mode)
nc -zv 192.168.1.1 20-80
Transfer file (sender)
Send file to a remote listener
nc -lvp 4444 < file.tar.gz
Transfer file (receiver)
Receive a file from a netcat sender
nc 192.168.1.1 4444 > file.tar.gz
UDP mode
Connect using UDP instead of TCP
nc -u 192.168.1.1 5005
Simple HTTP request
Send a raw HTTP GET request with netcat
echo -e "GET / HTTP/1.0
" | nc example.com 80
Reverse shell (attacker listener)
Wait for an incoming reverse shell connection
nc -lvp 4444
Banner grabbing
Connect to port and read service banner
nc -v 192.168.1.1 22
Timeout on connect
Set connection timeout to 3 seconds
nc -w 3 192.168.1.1 80
no commands match