summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/nc.1
diff options
context:
space:
mode:
authoraaron <>1998-09-27 16:57:47 +0000
committeraaron <>1998-09-27 16:57:47 +0000
commitb63a69d9273ccf50124a8571536e468986bd2d11 (patch)
tree2b7b54bb3fb7cf91223e89841452ef1ae5e5379a /src/usr.bin/nc/nc.1
parent583667bf28d2a703b3c969f239bff42bb5aedce2 (diff)
downloadopenbsd-b63a69d9273ccf50124a8571536e468986bd2d11.tar.gz
openbsd-b63a69d9273ccf50124a8571536e468986bd2d11.tar.bz2
openbsd-b63a69d9273ccf50124a8571536e468986bd2d11.zip
usr.bin/ man page cleanups, n-s
Diffstat (limited to 'src/usr.bin/nc/nc.1')
-rw-r--r--src/usr.bin/nc/nc.159
1 files changed, 31 insertions, 28 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1
index 2900fc7601..8ada12ff95 100644
--- a/src/usr.bin/nc/nc.1
+++ b/src/usr.bin/nc/nc.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: nc.1,v 1.2 1998/03/11 18:42:23 deraadt Exp $ 1.\" $OpenBSD: nc.1,v 1.3 1998/09/27 16:57:47 aaron Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 David Sacerdote 3.\" Copyright (c) 1996 David Sacerdote
4.\" All rights reserved. 4.\" All rights reserved.
@@ -26,12 +26,11 @@
26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27.\" 27.\"
28.Dd August 1, 1996 28.Dd August 1, 1996
29.Dt nc 1 29.Dt NC 1
30.Sh NAME 30.Sh NAME
31.Os 31.Os
32.Nm nc 32.Nm nc
33.Nd 33.Nd arbitrary TCP and UDP connections and listens
34Arbitrary tcp and udp connections and listens.
35.Pp 34.Pp
36.Sh SYNOPSIS 35.Sh SYNOPSIS
37.Nm nc 36.Nm nc
@@ -53,8 +52,8 @@ The
53(or 52(or
54.Nm netcat ) 53.Nm netcat )
55utility is used for just about anything under the sun 54utility is used for just about anything under the sun
56involving TCP or UDP. It can open tcp connections, send udp packets, 55involving TCP or UDP. It can open TCP connections, send UDP packets,
57listen on arbitrary tcp and udp ports, do port scanning, and source 56listen on arbitrary TCP and UDP ports, do port scanning, and source
58routing. Unlike 57routing. Unlike
59.Xr telnet 1 , 58.Xr telnet 1 ,
60.Nm nc 59.Nm nc
@@ -71,9 +70,9 @@ ranges may be specified on the command line.
71Common uses include: 70Common uses include:
72.Bl -bullet 71.Bl -bullet
73.It 72.It
74simple tcp proxies 73simple TCP proxies
75.It 74.It
76shell\-script based http clients and servers 75shell\-script based HTTP clients and servers
77.It 76.It
78network daemon testing 77network daemon testing
79.It 78.It
@@ -103,7 +102,7 @@ Also causes a delay time between connections to multiple ports.
103Is used to specify that 102Is used to specify that
104.Nm nc 103.Nm nc
105should listen for an incoming connection, rather than initiate a 104should listen for an incoming connection, rather than initiate a
106connection to a remote host. Any hostname/ip address and port arguments 105connection to a remote host. Any hostname/IP address and port arguments
107restrict the source of inbound connections to only that address and 106restrict the source of inbound connections to only that address and
108source port. 107source port.
109.It Fl n 108.It Fl n
@@ -111,20 +110,21 @@ Do not do DNS lookups on any of the specified addresses or hostnames, or
111names of port numbers from /etc/services. 110names of port numbers from /etc/services.
112.It Fl o Ar filename 111.It Fl o Ar filename
113Create a hexadecimal log of data transferred in the specified file. 112Create a hexadecimal log of data transferred in the specified file.
114Each line begins with < or >. < means "from the net" and > means 113Each line begins with ``<'' or ``>''. ``<'' means "from the net" and ``>''
115"to the net." 114means "to the net".
116.It Fl p Ar port 115.It Fl p Ar port
117Specifies the source port 116Specifies the source port
118.Nm nc 117.Nm nc
119should use, subject to privilege restrictions and availability. 118should use, subject to privilege restrictions and availability.
120.It Fl r 119.It Fl r
121Specified that source and/or destination ports should be chosen semi-randomly 120Specifies that source and/or destination ports should be chosen semi-randomly
122instead of sequentially within a range or in the order that the 121instead of sequentially within a range or in the order that the
123system assigns. 122system assigns.
124.It Fl s Ar hostname/ip-address 123.It Fl s Ar hostname/ip-address
125Specifies the ip of the interface which is used to send the packets. 124Specifies the IP of the interface which is used to send the packets.
126On some platforms, this can be used for udp spoofing by using ifconfig 125On some platforms, this can be used for UDP spoofing by using
127to bring up a dummy interface with the desired source ip address. 126.Xr ifconfig 8
127to bring up a dummy interface with the desired source IP address.
128.It Fl t 128.It Fl t
129Causes 129Causes
130.Nm nc 130.Nm nc
@@ -143,7 +143,8 @@ sends.
143.It Fl v 143.It Fl v
144Verbose. Cause 144Verbose. Cause
145.Nm nc 145.Nm nc
146to display connection information. Using \-v 146to display connection information. Using
147.Fl v
147more than once will cause 148more than once will cause
148.Nm nc 149.Nm nc
149to become even more verbose. 150to become even more verbose.
@@ -160,9 +161,10 @@ Specifies that
160should just scan for listening 161should just scan for listening
161daemons, without sending any data to them. Diagnostic messages about refused 162daemons, without sending any data to them. Diagnostic messages about refused
162connections will not be 163connections will not be
163displayed unless \-v is specified twice. 164displayed unless
165.Fl v
166is specified twice.
164.Sh EXAMPLES 167.Sh EXAMPLES
165.Pp
166.Bl -tag -width x 168.Bl -tag -width x
167.It Li "nc" 169.It Li "nc"
168Wait for the user to type what would normally be command-line 170Wait for the user to type what would normally be command-line
@@ -174,27 +176,27 @@ fails, do not display any error messages, but simply exit.
174Open a TCP connection to port 42 of example.host, and use port 31337 176Open a TCP connection to port 42 of example.host, and use port 31337
175as the source port. 177as the source port.
176.It Li "nc -w 5 example.host 42" 178.It Li "nc -w 5 example.host 42"
177Open a tcp connection to port 42 of example.host, and time out after 179Open a TCP connection to port 42 of example.host, and time out after
178five seconds while attempting to connect. 180five seconds while attempting to connect.
179.It Li "nc -u example.host 53" 181.It Li "nc -u example.host 53"
180Send any data from stdin 182Send any data from stdin
181to UDP port 53 of example.host, and display any data returned. 183to UDP port 53 of example.host, and display any data returned.
182.It Li "nc -s 10.1.2.3 example.host 42" 184.It Li "nc -s 10.1.2.3 example.host 42"
183Open a tcp connection to port 42 of example.host using 10.1.2.3 as the 185Open a TCP connection to port 42 of example.host using 10.1.2.3 as the
184ip for the local end of the connection. 186IP for the local end of the connection.
185.It Li "nc -v example.host 42" 187.It Li "nc -v example.host 42"
186Open a tcp connection to port 42 of example.host, displaying some 188Open a TCP connection to port 42 of example.host, displaying some
187diagnostic messages on stderr. 189diagnostic messages on stderr.
188.It Li "nc -v -v example.host 42" 190.It Li "nc -v -v example.host 42"
189Open a tcp connection to port 42 of example.host, displaying all 191Open a TCP connection to port 42 of example.host, displaying all
190diagnostic messages on stderr. 192diagnostic messages on stderr.
191.It Li "nc -v -z example.host 20-30" 193.It Li "nc -v -z example.host 20-30"
192Attempt to open tcp connections to ports 20 through 30 of 194Attempt to open TCP connections to ports 20 through 30 of
193example.host, and report which ones 195example.host, and report which ones
194.Nm nc 196.Nm nc
195was able to connect to. 197was able to connect to.
196.It Li "nc -v -u -z -w 3 example.host 20-30" 198.It Li "nc -v -u -z -w 3 example.host 20-30"
197Send udp packets to ports 20-30 of example.host, and report which ones 199Send UDP packets to ports 20-30 of example.host, and report which ones
198did not respond with an ICMP packet after three seconds. 200did not respond with an ICMP packet after three seconds.
199.It Li "nc -l -p 3000" 201.It Li "nc -l -p 3000"
200Listen on TCP port 3000, and once there is a connection, send stdin to 202Listen on TCP port 3000, and once there is a connection, send stdin to
@@ -205,10 +207,11 @@ followed by a newline, and move data from port 1000 of example.host to
205stdout until example.host closes the connection. 207stdout until example.host closes the connection.
206.El 208.El
207.Sh SEE ALSO 209.Sh SEE ALSO
208.Xr telnet 1 ,
209.Xr cat 1 , 210.Xr cat 1 ,
210and the 211.Xr telnet 1
212.Pp
213The
211.Nm netcat 214.Nm netcat
212.Pa README 215.Pa README .
213.Sh AUTHOR 216.Sh AUTHOR
214*Hobbit* [hobbit@avian.org] 217*Hobbit* [hobbit@avian.org]