UnixDroid

Lesson 3 of 6 · 7 min

Step 3: ports, 65,535 doors

What ports are, the ones you'll see most, and why Nmap only checks the top 1,000 by default.

If an IP address is a building, ports are its doors. Each service listens on a port number: web servers on 80/443, SSH on 22, and so on.

The numbers

TCP and UDP each have 65,535 ports (1–65535). Every device has both sets.

PortService
21FTP
22SSH
25SMTP (mail)
53DNS
80 / 443HTTP / HTTPS
445SMB (Windows file sharing)
3389RDP (Windows remote desktop)

What Nmap scans by default

Scanning all 65,535 ports on every host is slow, so by default Nmap checks the top 1,000 most common TCP ports.

nmap 10.0.2.5          # top 1,000 TCP ports
nmap -F 10.0.2.5       # top 100, faster
nmap -p- 10.0.2.5      # all 65,535 TCP ports
sudo nmap -sU --top-ports 20 10.0.2.5   # UDP is separate and slower

A service on an unusual port (say SSH on 2222) can be missed by a default scan. That's why -p- matters on real tests.

Reference: Ports and protocols explained.

Try it yourself
  1. Scan your Metasploitable VM with default settings.
  2. Scan it again with -p- and compare: did new ports appear?
  3. Match each open port to its service using the table.
No Linux machine? Practise in the free online terminal

Quick check

How many ports does Nmap scan by default? (number)

Need a hint?

The most common ones only.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →