diff options
author | jmc <> | 2005-07-17 19:15:38 +0000 |
---|---|---|
committer | jmc <> | 2005-07-17 19:15:38 +0000 |
commit | 3c67f235e252fc1186d40040048f35d18cb56d3e (patch) | |
tree | 230e197c3be628bcf176605aa4065e360bd12e83 /src/usr.bin/nc/nc.1 | |
parent | 4de45f44b68d96895d9e7b0c49ac7e87dd43454b (diff) | |
download | openbsd-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.1 | 25 |
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 | |||
291 | in response to commands issued by the client. | 291 | in response to commands issued by the client. |
292 | For example, to retrieve the home page of a web site: | 292 | For 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 |
296 | Note that this also displays the headers sent by the web server. | 296 | Note that this also displays the headers sent by the web server. |
297 | They can be filtered, using a tool such as | 297 | They can be filtered, using a tool such as |
@@ -319,15 +319,11 @@ The | |||
319 | .Fl z | 319 | .Fl z |
320 | flag can be used to tell | 320 | flag can be used to tell |
321 | .Nm | 321 | .Nm |
322 | not to initiate a connection, | 322 | to report open ports, |
323 | together with the | 323 | rather than initiate a connection. |
324 | .Fl v | ||
325 | .Pq verbose | ||
326 | flag, | ||
327 | to report open ports. | ||
328 | For example: | 324 | For 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 |
331 | Connection to host.example.com 22 port [tcp/ssh] succeeded! | 327 | Connection to host.example.com 22 port [tcp/ssh] succeeded! |
332 | Connection to host.example.com 25 port [tcp/smtp] succeeded! | 328 | Connection 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 |
368 | Send UDP packets to ports 20-30 of host.example.com, and report which ones | ||
369 | responded with an ICMP packet after three seconds: | ||
370 | .Pp | ||
371 | .Dl $ nc -uvz -w 3 host.example.com 20-30 | ||
372 | .Pp | ||
373 | Create and listen on a Unix Domain Socket: | 364 | Create 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 |
395 | Rewritten with IPv6 support by | 386 | Rewritten with IPv6 support by |
396 | .An Eric Jackson Aq ericj@monkey.org . | 387 | .An Eric Jackson Aq ericj@monkey.org . |
388 | .Sh CAVEATS | ||
389 | UDP port scans will always succeed | ||
390 | (i.e. report the port as open), | ||
391 | rendering the | ||
392 | .Fl uz | ||
393 | combination of flags relatively useless. | ||