Port Scanning

-Pn : Avoid host discovery phase.

Default scans

Nmap offers a lot of scanning options to specify the scanning technique. But if none were specified, nmap chooses a default scan type which depends solely on the privileges the user have. Here's a quick explanation:

Drawing
Figure1

Discovering OPEN TCP Ports

Discovering OPEN UDP Ports (Much slower than TCP)

triangle-exclamation
Drawing
UDP scans possible outputs.

Service detection:

Primarily nmap prints out the banners of the scanned ports. If nmap cannot identify versions through banner grabbing, it performs a signature-based matching system which increases the duration.

triangle-exclamation

Let's prepare the intercept network traffic using tcpdump

Now let's netcat to the target machine an look at the intercepted traffic in tcpdump output:

circle-info
  1. SYN sent.

  2. SYN/ACK received.

  3. ACK sent.

  4. PSH/ACK received. (Exactly where the confusion happens.)

  5. ACK sent.

Last updated