NetCat (NC)ΒΆ
USAGEΒΆ
DESCRIPTIONΒΆ
The nc (or netcat) utility is used for almost anything involving TCP, UDP, or UNIX sockets. It can establish TCP connections, send UDP ackets, listen on arbitrary TCP and UDP ports, perform port scanning, and handle IPv4 and IPv6.
Command OptionsΒΆ
| Options | Description |
|---|---|
| -4 | Forces nc to use IPv4 addresses only |
| -6 | Forces nc to use IPv6 addresses only |
| -l | Instruct netcat to listen for incoming connections |
| -v | Provide verbose output |
| -n | Disable DNS lookup on ip addresses and hostnames |
| -p | Specifies the source port netcat should use |
| -w | Specifies the timeout value |
| -u | Use UDP instead of the default option of TCP |
| -k | Forces netcat to continue listening after disconnection |
| -z | Instructs nmap to scan for listening daemons |
| -h | Show nmap help |
| -x | Use nmap with a prox |
Port Scanning & Banner GrabbingΒΆ
| Command | Description |
|---|---|
nc -zvn 192.168.59.1 1-100 |
Scan for ports between 1 and 100 |
nc -zvn 192.168.59.1 80 22 443 |
Scan port 80, 22 and 443 |
nc -zvn 192.168.59.1 80 |
Scan only port 80 |
nc -zvn sysexplore.com 80 |
Scan for port 80 on sysexplore.com |
nc sysxplore.com 80 |
Grab sysxplore.com banner |
REMOTE SHELLΒΆ
Server (192.168.59.3)ΒΆ
ClientΒΆ
REVERSE SHELLΒΆ
Attacker's Machine (192.168.59.3)ΒΆ
Victim's MachineΒΆ
DOWNLOADINGΒΆ
Sending Side (192.168.59.3)ΒΆ
Receiving SideΒΆ
UPLOADINGΒΆ
Receiving (192.168.59.3)ΒΆ
Sending SideΒΆ
CHAT APPΒΆ
Server (192.168.59.3)ΒΆ
ClientΒΆ
VIDEO STREAMINGΒΆ
Server (192.168.59.3)ΒΆ
ClientΒΆ
COMPRESS AND TRANSFERΒΆ
Sending SideΒΆ
Receiving Side (192.168.59.54)ΒΆ
This is very useful when you want to transfer directories
ENCRYPT AND TRANSFERΒΆ
Sending Side (192.168.59.3)ΒΆ
Recelving SideΒΆ
File transfers using netcat are not encrypted by default, anyone on the network can grab what you are sending, so it is important to encrypt data before sending.
CLONING LINUX DISK DRIVEΒΆ
Sending Side (192.168.59.3)ΒΆ
Receiving SideΒΆ
This is very handy when you want to clone a Linux system.
