diff options
Diffstat (limited to 'src')
-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. | ||