summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/nc.1
diff options
context:
space:
mode:
authorjmc <>2005-07-17 19:15:38 +0000
committerjmc <>2005-07-17 19:15:38 +0000
commit3c67f235e252fc1186d40040048f35d18cb56d3e (patch)
tree230e197c3be628bcf176605aa4065e360bd12e83 /src/usr.bin/nc/nc.1
parent4de45f44b68d96895d9e7b0c49ac7e87dd43454b (diff)
downloadopenbsd-3c67f235e252fc1186d40040048f35d18cb56d3e.tar.gz
openbsd-3c67f235e252fc1186d40040048f35d18cb56d3e.tar.bz2
openbsd-3c67f235e252fc1186d40040048f35d18cb56d3e.zip
some improvements from alf schlichting:
- correct syntax for retrieving an http page. this example further corrected by ian darwin (thanks!) - the -v flag is relatively useless when port scanning, so remove it from the example, and reword the description appropriately - udp port scans always report ports as open (i.e. are useless) so remove example claiming it works, and add CAVEATS to note that -uz is relatively useless
Diffstat (limited to 'src/usr.bin/nc/nc.1')
-rw-r--r--src/usr.bin/nc/nc.125
1 files changed, 11 insertions, 14 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1
index c82e6efe4a..19dcad5d5f 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.38 2005/05/20 10:55:09 jmc Exp $ 1.\" $OpenBSD: nc.1,v 1.39 2005/07/17 19:15:38 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 David Sacerdote 3.\" Copyright (c) 1996 David Sacerdote
4.\" All rights reserved. 4.\" All rights reserved.
@@ -291,7 +291,7 @@ when it might be necessary to verify what data a server is sending
291in response to commands issued by the client. 291in response to commands issued by the client.
292For example, to retrieve the home page of a web site: 292For example, to retrieve the home page of a web site:
293.Pp 293.Pp
294.Dl $ echo \&"GET\&" | nc host.example.com 80 294.Dl $ echo -n \&"GET / HTTP/1.0\er\en\er\en\&" | nc host.example.com 80
295.Pp 295.Pp
296Note that this also displays the headers sent by the web server. 296Note that this also displays the headers sent by the web server.
297They can be filtered, using a tool such as 297They can be filtered, using a tool such as
@@ -319,15 +319,11 @@ The
319.Fl z 319.Fl z
320flag can be used to tell 320flag can be used to tell
321.Nm 321.Nm
322not to initiate a connection, 322to report open ports,
323together with the 323rather than initiate a connection.
324.Fl v
325.Pq verbose
326flag,
327to report open ports.
328For example: 324For example:
329.Bd -literal -offset indent 325.Bd -literal -offset indent
330$ nc -vz host.example.com 20-30 326$ nc -z host.example.com 20-30
331Connection to host.example.com 22 port [tcp/ssh] succeeded! 327Connection to host.example.com 22 port [tcp/ssh] succeeded!
332Connection to host.example.com 25 port [tcp/smtp] succeeded! 328Connection to host.example.com 25 port [tcp/smtp] succeeded!
333.Ed 329.Ed
@@ -365,11 +361,6 @@ IP for the local end of the connection:
365.Pp 361.Pp
366.Dl $ nc -s 10.1.2.3 host.example.com 42 362.Dl $ nc -s 10.1.2.3 host.example.com 42
367.Pp 363.Pp
368Send UDP packets to ports 20-30 of host.example.com, and report which ones
369responded with an ICMP packet after three seconds:
370.Pp
371.Dl $ nc -uvz -w 3 host.example.com 20-30
372.Pp
373Create and listen on a Unix Domain Socket: 364Create and listen on a Unix Domain Socket:
374.Pp 365.Pp
375.Dl $ nc -lU /var/tmp/dsocket 366.Dl $ nc -lU /var/tmp/dsocket
@@ -394,3 +385,9 @@ Original implementation by *Hobbit*
394.br 385.br
395Rewritten with IPv6 support by 386Rewritten with IPv6 support by
396.An Eric Jackson Aq ericj@monkey.org . 387.An Eric Jackson Aq ericj@monkey.org .
388.Sh CAVEATS
389UDP port scans will always succeed
390(i.e. report the port as open),
391rendering the
392.Fl uz
393combination of flags relatively useless.