.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "NETCAT 1" .TH NETCAT 1 "2004-01-11" "GNU Netcat 0.7.1" "Netcat" .SH "NAME" netcat \- GNU Netcat Manual .SH "SYNOPSIS" .IX Header "SYNOPSIS" netcat [options] hostname port [port] ... .PP netcat \-l \-p port [options] [hostname] [port] ... .PP netcat \-L hostname:port \-p port [options] ... .SH "DESCRIPTION" .IX Header "DESCRIPTION" Netcat is a simple Unix utility which reads and writes data across network connections, using \s-1TCP\s0 or \s-1UDP\s0 protocol. It is designed to be a reliable \*(L"back\-end\*(R" 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 \*(L"nc\*(R" as the original program was named, should have been supplied long ago as another one of those cryptic but standard Unix tools. .PP Netcat has three main modes of functionality. These are the connect mode, the listen mode, and the tunnel mode. .PP The most common mode is the connect mode, which for example allows the output of a locally called command to be redirected for example to a remote netcat listening or to any other kind of daemon waiting for a connection. .PP On the other hand, the listen mode can be used to obtain some kind of stream of data from a remote site. .PP The most new feature is the tunnel mode, which is a powerful and reliable mode that allows tunneling a remote site towards any other remote site, allowing to specify for example from which interface create the connection and from which port. .SH "OPTIONS" .IX Header "OPTIONS" .Sh "Basic Startup Options" .IX Subsection "Basic Startup Options" .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" .PD Display the version of netcat and exit. .IP "\fB\-h\fR" 4 .IX Item "-h" .PD 0 .IP "\fB\-\-help\fR" 4 .IX Item "--help" .PD Print a help message describing most common netcat's command-line switches and a short description. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 .IP "\fB\-\-verbose\fR" 4 .IX Item "--verbose" .PD Prints status messages, usually needed for using netcat as user front\-end. All messages are printed to stderr in order not to affect the data stream. .Sp Use this option double to get more messages. .Sh "Protocol and Interface Options" .IX Subsection "Protocol and Interface Options" .IP "\fB\-t\fR" 4 .IX Item "-t" .PD 0 .IP "\fB\-\-tcp\fR" 4 .IX Item "--tcp" .PD Selects the \s-1TCP\s0 protocol, this is the default. It may be useful (see Tunnel Mode) to specify this option after for example the \s-1UDP\s0 option in order to allow a cross-protocol bridge between \s-1TCP\s0 and \s-1UDP\s0. .IP "\fB\-u\fR" 4 .IX Item "-u" .PD 0 .IP "\fB\-\-udp\fR" 4 .IX Item "--udp" .PD Selects the \s-1UDP\s0 protocol. See the \-\-tcp option. .IP "\fB\-p \s-1NUM\s0\fR" 4 .IX Item "-p NUM" .PD 0 .IP "\fB\-\-local\-port=NUM\fR" 4 .IX Item "--local-port=NUM" .PD Selects the local port. In listen and tunnel mode, it specifies which port to use for listening, while in connect mode it specifies the source port (the port from which originating the connection). .Sp If this option is not specified, the \s-1OS\s0 will assign a random available port. .IP "\fB\-s \s-1ADDRESS\s0\fR" 4 .IX Item "-s ADDRESS" .PD 0 .IP "\fB\-\-source=ADDRESS\fR" 4 .IX Item "--source=ADDRESS" .PD Specifies the source address used for creating sockets. In listen mode and tunnel mode this switch specifies the bound address, and it is generally a good idea not to specify this, which causes netcat to bind to a generic interface. In the connect mode, this switch is used to specify the source address for connecting to the outside world. Again, if it's not specified a proper address for the destination route will be used. .IP "\fB\-P \s-1NUM\s0\fR" 4 .IX Item "-P NUM" .PD 0 .IP "\fB\-\-tunnel\-port=NUM\fR" 4 .IX Item "--tunnel-port=NUM" .PD Same as \-\-port, but affects only the connect phase (thus this option has no effect in listen mode). This switch is useful in tunnel mode for specifying the source port for the connecting socket. .IP "\fB\-S \s-1ADDRESS\s0\fR" 4 .IX Item "-S ADDRESS" .PD 0 .IP "\fB\-\-tunnel\-source=ADDRESS\fR" 4 .IX Item "--tunnel-source=ADDRESS" .PD Same as \-\-source, but affects only the connect phase (thus this has no effects in listen mode). This switch is useful in tunnel mode for specifying the source address for the connecting socket. .Sh "Advanced Options" .IX Subsection "Advanced Options" .IP "\fB\-i \s-1SECS\s0\fR" 4 .IX Item "-i SECS" .PD 0 .IP "\fB\-\-interval \s-1SECS\s0\fR" 4 .IX Item "--interval SECS" .PD sets the buffering output delay time. This affects all the current modes and makes the connection sock to buffer outgoing data. This means that in tunnel mode everything received from the listening socket is buffered for the connect socket. .IP "\fB\-n\fR" 4 .IX Item "-n" .PD 0 .IP "\fB\-\-dont\-resolve\fR" 4 .IX Item "--dont-resolve" .PD Don't do \s-1DNS\s0 lookups on any of the specified addresses or hostnames, or names of port numbers from /etc/services. .IP "\fB\-r\fR" 4 .IX Item "-r" .PD 0 .IP "\fB\-\-randomize\fR" 4 .IX Item "--randomize" .PD Randomizes the target remote ports ranges. If more than one range is specified it will randomize the ports in the whole global range. .IP "\fB\-w\fR" 4 .IX Item "-w" .PD 0 .IP "\fB\-\-wait=SECS\fR" 4 .IX Item "--wait=SECS" .PD Specifies the starting inactivity delay after which netcat will exit with an error status. In connect mode and in tunnel mode this specifies the timeout for the connecting socket, while in listen mode it specifies the time to wait for a \s-1VALID\s0 incoming connection (see listen mode). .IP "\fB\-T\fR" 4 .IX Item "-T" .PD 0 .IP "\fB\-\-telnet\fR" 4 .IX Item "--telnet" .PD Answers the telnet codes as described in \s-1RFC0854\s0. This makes possible to use netcat to script telnet sessions. The incoming telnet codes are parsed inside the receiving queue and are stripped off before forwarding the data as they were never received, so the application doesn't have to parse the codes itself (this behaviour can be disabled at compile time with \&\-\-enable\-oldtelnet or with \-\-enable\-compat). .IP "\fB\-z\fR" 4 .IX Item "-z" .PD 0 .IP "\fB\-\-zero\fR" 4 .IX Item "--zero" .PD Sets the zero I/O flag for the selected mode. In connect mode it means that as soon as the port is open it is immediately shutdown and closed. This may be useful for probing or scanning (even if there are faster portscanners out there, but this may be useful for scripting purposes). In listen mode, it makes netcat refusing all the incoming connections thus running in timeout (if set), or waiting forever. In both cases, no data is transfered. .Sp This option is incompatible with the tunnel mode. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1GNU\s0 Info entry for \fInetcat\fR. .SH "AUTHOR" .IX Header "AUTHOR" Originally written by Giovanni Giacobbi . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2002 \- 2004 Giovanni Giacobbi .PP Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``\s-1GNU\s0 Free Documentation License'', with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``\s-1GNU\s0 Free Documentation License''.