NetCat command-line options with definitions
{LANG_NAVORIGIN} Reference
Description
netcat is a simple unix utility which reads and writes data across network connections, using
TCP or UDP protocol. It is designed to be a reliable "back-end" tool that can be used directly
or easily driven by other programs and scripts. At the same time, it is a feature-rich
network debugging and exploration tool, since it can create almost any kind of connection you
would need and has several interesting built-in capabilities. Netcat, or "nc" as the actual
program is named, should have been supplied long ago as another one of those cryptic but
standard Unix tools.
In the simplest usage, "nc host port" creates a TCP connection to the given port on the
given target host. Your standard input is then sent to the host, and anything that comes
back across the connection is sent to your standard output. This continues indefinitely, until
the network side of the connection shuts down. Note that this behavior is different from most
other applications which shut everything down and exit after an end-of-file on the standard
input.
Arguments Cheat Sheet
The following are the most useful uses of netcat:
For windows
nc –d can be used to detach from the console.
| nc –l –p [port] |
will create a simple listening tcp port. Add –u to put into UDP mode. |
| nc –e [program] |
To redirect stdin/stdout from program. |
| nc –w [timeout] |
To set a timeout before netcat automatically quits. (Used within a loop usually) |
| program | nc |
To pipe output of program to netcat |
| nc | program |
To pipe output of netcat to program |
| nc –h |
Help sheet |
| nc –v |
To put into verbose mode, or use –v –v to put into ultra-verbose mode! |
| nc –g or nc –G |
Source routing flags |
| nc –t |
Use telnet negotiation (If connecting to a telnetd or acting as a telnetd for telnet
clients). |
| nc –o [file] |
Hex dump traffic to file |
| nc –z |
No I/O (Used for scanning ports) |
E-Mail Link
Your IP address will be sent with this e-mail