netcat
Netcat-traditional is a simple Unix utility that reads and writes data across TCP or UDP network connections. It serves as a reliable back-end tool for scripts and a feature-rich network debugging and exploration utility.
Description
Netcat-traditional, the classic version written by Hobbit, is a TCP/IP swiss army knife designed for creating connections and performing network tasks. It lacks many features found in netcat-openbsd but provides core functionality for reading and writing data across network connections using TCP or UDP protocols. This tool is ideal as a back-end for other programs and scripts, enabling reliable data transfer and network interactions.
Use cases include network debugging, exploration, port scanning, and creating connections for file transfers or shells. It supports inbound listening and outbound connections, with capabilities like broadcasting, source-routing, and executing programs after connect. The tool is feature-rich for almost any connection type needed in penetration testing or networking tasks.
Installed size is 139 KB with dependency on libc6. It includes the nc.traditional binary for command-line usage.
How It Works
Netcat-traditional operates by establishing TCP or UDP connections to read and write data streams. It can connect to a hostname and port(s) or listen on a specified port for inbound connections. Built-in capabilities include delay intervals for line sending or port scanning, keepalive options, source-routing via gateways, broadcasting, and executing shell commands or programs post-connection using /bin/sh or specified filenames. Port specifications support individuals or ranges (lo-hi inclusive), with backslash-escaped hyphens in port names.
Installation
sudo apt install netcat-traditionalFlags
Examples
nc.traditional -hnc [-options] hostname port[s] [ports] ...nc -l -p port [-options] [hostname] [port]nc -c shell commands hostname portnc -e filename hostname portnc -b hostname portnc -i secs hostname lo-hi