Netcat/4/en

From aldeid
Jump to navigation Jump to search

Port Scanning

Netcat provides an option for port scanning as shown by the following results:

$ nc -v -w 2 -z 127.0.0.1 1-200
DNS fwd/rev mismatch: localhost != xpsp2-20cc7397e
localhost [127.0.0.1] 135 (epmap) open
localhost [127.0.0.1] 110 (pop3) open
localhost [127.0.0.1] 25 (smtp) open
Note
The -z option speeds up the scan to the extent that no further information on port status is displayed. In the case where -z option is not present, version information, if available, are displayed along with the state of ports.
$ echo QUIT | nc -v -w 3 12.345.67.89 1-100
localhost [127.0.0.1] 80 (www) open
<b>Welcome to Apache 2.2</b>
localhost [127.0.0.1] 25 (smtp) open
localhost [127.0.0.1] 22 (ssh) open
SSH-2.0-OpenSSH_5.1p1 Debian-5
Protocol mismatch.