Module 4 ยท Lesson 2 ยท 30 minutes

โšก nmap in practice โ€” 4 levels of depth

From "a quick glance at open windows" to "a full server portrait". Using analogies, without long tables of flags.

๐Ÿ“– Why you need to know this

In the previous lesson, we understood the idea: a scanner walks around a house and tries every window. Now โ€” how to do it.

Imagine you are an investigator. You have 4 levels of house inspection:

  • A quick glance from the street โ€” which windows are lit
  • Careful โ€” what kind of lamp is in each window, what brand
  • Standard inspection with basic tests โ€” is the gate open, is there a dog
  • Full portrait โ€” all of the above + find out whose house it is

These are the 4 main ways to use nmap. You don't need to memorize a bunch of flags โ€” you need to understand the 4 levels and when to use each.

๐Ÿšช Level 1: "A Quick Glance"

๐ŸŽฏ In a nutshell in 30 seconds

The very first command of any hacker. Run it and in 5-30 seconds find out which windows (ports) are open on the server.

nmap scanme.nmap.org

What you'll see:

PORT      STATE    SERVICE
22/tcp    open     ssh
80/tcp    open     http
9929/tcp  open     nping-echo
31337/tcp open     Elite

That's it. Which windows are open, what's roughly inside them. No details. This is how every server investigation in the world begins.

๐Ÿ” Level 2: "What version is the program in the window"

๐ŸŽฏ In a nutshell in 30 seconds

Knowing "window 22 is SSH" is useful. Knowing "window 22 is OpenSSH 6.6 from 2014" is 100 times more valuable.

Old version = high chance that methods for exploiting it have already been published on the internet (this is called CVE โ€” Common Vulnerabilities and Exposures).

nmap -sV scanme.nmap.org

The flag -sV = "Version". Don't memorize it as a formula โ€” remember "s-V adds versions".

PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 6.6.1p1 Ubuntu  โ† version!
80/tcp  open  http    Apache httpd 2.4.7      โ† version!

Now Google: "OpenSSH 6.6.1 CVE" โ†’ you'll find specific vulnerabilities. This is the main mechanism for exploiting old servers.

๐Ÿค Level 3: "Standard Checks"

๐ŸŽฏ In a nutshell in 30 seconds

nmap has ~600 built-in checks for common issues. You can run a "basic set" with a single command โ€” it will check the most popular ones itself.

nmap -sC scanme.nmap.org

The flag -sC = "Scripts default". What it will check itself:

You don't need to memorize every check. Run it and read the output โ€” everything is clearly labeled there.

๐Ÿ‘‘ Level 4: "Full Server Portrait"

๐ŸŽฏ In a nutshell in 30 seconds

One command โ€” everything above + OS + route to the server.

This is the main command for the first 5 minutes of any investigation.

sudo nmap -A scanme.nmap.org

The flag -A = "All / Aggressive". Remember it as "aggressive โ€” that's a full portrait".

What you'll get in one minute:

This is enough to immediately understand โ€” "is there anything interesting here to investigate".

๐Ÿ“‹ Cheat Sheet: Which Level When

What I wantCommandTime
Quickly understand what's opennmap target~10 sec
Find out service versionsnmap -sV target~30 sec
Run standard checksnmap -sC target~1 min
Full portraitsudo nmap -A target~2-5 min

๐Ÿ“ How to scan specific windows

By default, nmap will check the "top-1000" windows. This is sufficient in 99% of cases. But sometimes you want to do it differently:

# Only windows 80 and 443
nmap -p 80,443 target

# ALL 65535 windows (slow, but complete)
nmap -p- target

Memorizing is not mandatory. When you need it โ€” ask Claude or Google it.

๐ŸŽฏ How a real pentester uses nmap

๐Ÿ’ก Two-step strategy

Experienced hackers don't do a full scan right away. They do this:

  1. Step 1 โ€” quick reconnaissance: nmap -p- --min-rate 5000 target โ€” which windows are open at all (5 minutes instead of an hour)
  2. Step 2 โ€” full portrait of only the found windows: sudo nmap -A -p 22,80,443 target

Why this way? Because a full portrait of 65,535 windows would take an hour. And the two-step strategy โ€” 10 minutes.

๐Ÿค” Simple understanding check test

๐Ÿ›  You don't have to do it, but it's interesting

Open Kali and perform 3 scans of scanme.nmap.org. This is legal โ€” the site is specifically for practice.

# 1. Quick glance
nmap scanme.nmap.org

# 2. Versions + standard checks
nmap -sV -sC scanme.nmap.org

# 3. Full portrait
sudo nmap -A scanme.nmap.org

Read the output. What did you learn? What OS? What services? What versions? Take this output and go to the next lesson โ€” there we will learn to analyze what we found.

๐Ÿค– Vibe-task: Ask Claude

Open Claude and ask:

I scanned scanme.nmap.org with the command `sudo nmap -A`.
Here is my output:

[insert nmap -A output here]

Explain to me like I'm 10 years old โ€” what am I looking at here?
Which windows are open? What roughly lives inside them?
What is the server's OS? How old are these programs?
Is there anything "juicy" here to investigate?