summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraaron <>2000-03-10 19:07:22 +0000
committeraaron <>2000-03-10 19:07:22 +0000
commit3e6562e2a770041c3b20bf8178470b6f81da3406 (patch)
treeb34e27ed9339c685ae791634d6bdbc5e23361f7a /src
parent6f49f8750388016173fa606647ac032ab286f200 (diff)
downloadopenbsd-3e6562e2a770041c3b20bf8178470b6f81da3406.tar.gz
openbsd-3e6562e2a770041c3b20bf8178470b6f81da3406.tar.bz2
openbsd-3e6562e2a770041c3b20bf8178470b6f81da3406.zip
Various cleanups and standardization.
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/nc/nc.163
1 files changed, 42 insertions, 21 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1
index 1c0cd6fa48..c069c29c11 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.6 1999/06/05 01:21:34 aaron Exp $ 1.\" $OpenBSD: nc.1,v 1.7 2000/03/10 19:07:22 aaron Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 David Sacerdote 3.\" Copyright (c) 1996 David Sacerdote
4.\" All rights reserved. 4.\" All rights reserved.
@@ -50,9 +50,11 @@ The
50(or 50(or
51.Nm netcat ) 51.Nm netcat )
52utility is used for just about anything under the sun 52utility is used for just about anything under the sun
53involving TCP or UDP. It can open TCP connections, send UDP packets, 53involving TCP or UDP.
54It can open TCP connections, send UDP packets,
54listen on arbitrary TCP and UDP ports, do port scanning, and source 55listen on arbitrary TCP and UDP ports, do port scanning, and source
55routing. Unlike 56routing.
57Unlike
56.Xr telnet 1 , 58.Xr telnet 1 ,
57.Nm 59.Nm
58scripts nicely, and separates error messages onto standard error instead 60scripts nicely, and separates error messages onto standard error instead
@@ -62,11 +64,13 @@ does with some.
62.Pp 64.Pp
63Destination ports can be single integers, names as listed in 65Destination ports can be single integers, names as listed in
64.Xr services 5 , 66.Xr services 5 ,
65or ranges. Ranges are in the form nn-mm, and several separate ports and/or 67or ranges.
68Ranges are in the form nn-mm, and several separate ports and/or
66ranges may be specified on the command line. 69ranges may be specified on the command line.
67.Pp 70.Pp
68Common uses include: 71Common uses include:
69.Bl -bullet 72.Pp
73.Bl -bullet -offset indent -compact
70.It 74.It
71simple TCP proxies 75simple TCP proxies
72.It 76.It
@@ -83,16 +87,19 @@ The options are as follows:
83.Bl -tag -width Ds 87.Bl -tag -width Ds
84.It Fl e Ar command 88.It Fl e Ar command
85Execute the specified command, using data from the network for stdin, 89Execute the specified command, using data from the network for stdin,
86and sending stdout and stderr to the network. This option is only present if 90and sending stdout and stderr to the network.
91This option is only present if
87.Nm 92.Nm
88was compiled with the GAPING_SECURITY_HOLE compile time option, since it 93was compiled with the GAPING_SECURITY_HOLE compile time option, since it
89allows users to make arbitrary programs available to anyone on the network. 94allows users to make arbitrary programs available to anyone on the network.
90.It Fl g Ar intermediate-host 95.It Fl g Ar intermediate-host
91Specifies a hop along a loose source routed path. Can be used more than 96Specifies a hop along a loose source routed path.
92once to build a chain of hop points. 97Can be used more than once to build a chain of hop points.
93.It Fl G Ar pointer 98.It Fl G Ar pointer
94Positions the "hop counter" within the list of machines in the path of 99Positions the
95a source routed packet. Must be a multiple of 4. 100.Dq hop counter
101within the list of machines in the path of a source routed packet.
102Must be a multiple of 4.
96.It Fl i Ar seconds 103.It Fl i Ar seconds
97Specifies a delay time interval between lines of text sent and received. 104Specifies a delay time interval between lines of text sent and received.
98Also causes a delay time between connections to multiple ports. 105Also causes a delay time between connections to multiple ports.
@@ -100,7 +107,8 @@ Also causes a delay time between connections to multiple ports.
100Is used to specify that 107Is used to specify that
101.Nm 108.Nm
102should listen for an incoming connection, rather than initiate a 109should listen for an incoming connection, rather than initiate a
103connection to a remote host. Any hostname/IP address and port arguments 110connection to a remote host.
111Any hostname/IP address and port arguments
104restrict the source of inbound connections to only that address and 112restrict the source of inbound connections to only that address and
105source port. 113source port.
106.It Fl n 114.It Fl n
@@ -108,8 +116,17 @@ Do not do DNS lookups on any of the specified addresses or hostnames, or
108names of port numbers from /etc/services. 116names of port numbers from /etc/services.
109.It Fl o Ar filename 117.It Fl o Ar filename
110Create a hexadecimal log of data transferred in the specified file. 118Create a hexadecimal log of data transferred in the specified file.
111Each line begins with ``<'' or ``>''. ``<'' means "from the net" and ``>'' 119Each line begins with
112means "to the net". 120.Ql <
121or
122.Ql > .
123.Ql <
124means
125.Dq from the net
126and
127.Ql >
128means
129.Dq to the net .
113.It Fl p Ar port 130.It Fl p Ar port
114Specifies the source port 131Specifies the source port
115.Nm 132.Nm
@@ -127,9 +144,11 @@ to bring up a dummy interface with the desired source IP address.
127Causes 144Causes
128.Nm 145.Nm
129to send RFC854 DON'T and WON'T responses to RFC854 DO 146to send RFC854 DON'T and WON'T responses to RFC854 DO
130and WILL requests. This makes it possible to use 147and WILL requests.
148This makes it possible to use
131.Nm 149.Nm
132to script telnet sessions. The presence of this option can be 150to script telnet sessions.
151The presence of this option can be
133enabled or disabled as a compile-time option. 152enabled or disabled as a compile-time option.
134.It Fl u 153.It Fl u
135Use UDP instead of TCP. 154Use UDP instead of TCP.
@@ -139,9 +158,11 @@ will behave as if a connection is established until it receives an
139ICMP packet indicating that there is no program listening to what it 158ICMP packet indicating that there is no program listening to what it
140sends. 159sends.
141.It Fl v 160.It Fl v
142Verbose. Cause 161Verbose.
162Cause
143.Nm 163.Nm
144to display connection information. Using 164to display connection information.
165Using
145.Fl v 166.Fl v
146more than once will cause 167more than once will cause
147.Nm 168.Nm
@@ -157,9 +178,8 @@ input closes.
157Specifies that 178Specifies that
158.Nm 179.Nm
159should just scan for listening 180should just scan for listening
160daemons, without sending any data to them. Diagnostic messages about refused 181daemons, without sending any data to them.
161connections will not be 182Diagnostic messages about refused connections with not be displayed unless
162displayed unless
163.Fl v 183.Fl v
164is specified twice. 184is specified twice.
165.Sh EXAMPLES 185.Sh EXAMPLES
@@ -168,7 +188,8 @@ is specified twice.
168Wait for the user to type what would normally be command-line 188Wait for the user to type what would normally be command-line
169arguments in at stdin. 189arguments in at stdin.
170.It Li "nc example.host 42" 190.It Li "nc example.host 42"
171Open a TCP connection to port 42 of example.host. If the connection 191Open a TCP connection to port 42 of example.host.
192If the connection
172fails, do not display any error messages, but simply exit. 193fails, do not display any error messages, but simply exit.
173.It Li "nc -p 31337 example.host 42" 194.It Li "nc -p 31337 example.host 42"
174Open a TCP connection to port 42 of example.host, and use port 31337 195Open a TCP connection to port 42 of example.host, and use port 31337