


Other ICMP unreachable errors (type 3, codes 1, 2, 9, 10, or 13) mark the port as filtered. If an ICMP port unreachable error (type 3, code 3) is returned, the port is closed. The –data-length option can be used to send a fixed-length random payload to every port or (if you specify a value of 0) to disable payloads. This is a mistake, as exploitable UDP services are quite common and attackers certainly don’t ignore the whole protocol. Because UDP scanning is generally slower and more difficult than TCP, some security auditors ignore these ports. DNS, SNMP, and DHCP (registered ports 53, 161/162, and 67/68) are three of the most common. While most popular services on the Internet run over the TCP protocol, UDP services are widely deployed. Instead of writing raw packets as most other scan types do, Nmap asks the underlying operating system to establish a connection with the target machine and port by issuing the connect system call. This is the case when a user does not have raw packet privileges. TCP connect scan is the default TCP scan type when SYN scan is not an option. It is also relatively unobtrusive and stealthy, since it never completes TCP connections. It can be performed quickly, scanning thousands of ports per second on a fast network not hampered by restrictive firewalls.

SYN scan is the default and most popular scan option, for good reasons.
