HackPathHackPath
CoursesRoadmapPracticePricing
>_
HackPath

Scanning & Exploitation - The Offensive Phase

0%
Lessons
Scanning & Vulnerability Enumeration
01Your First Network Scan — Understanding Before Using Nmap
50 min
02Scanning Techniques — Visibility, Detection, and Limits
50 min
03Advanced Enumeration with NSE
70 min
04From Version to CVE — Turning a Discovery into Risk
55 min
Exploitation
05Understanding Exploitation — Exploits, Payloads, and Shellcode
45 min
06Introduction to Metasploit
55 min
07First Exploits on Vulnerable Targets
60 min
08Manual Exploitation Without Metasploit
55 min
09Basic Post-Exploitation
30 min
10Vulnerability Reporting and Prioritization
60 min
Web Enumeration
11Analyzing a web application: reading weak signals
55 min
12Analyzing a web application: headers, technologies, and entry points
50 min
13Nikto — Scanning Web Vulnerabilities
45 min
Access Attacks
14Exploiting Weak Passwords with Hydra
55 min
15Basic SQL Injection
55 min
16XSS: Reflected and Stored Cross-Site Scripting
50 min
17Hash cracking with Hashcat
55 min
18Exploiting Misconfigured Services
60 min
Post-Exploitation
19Linux Privilege Escalation
60 min
20Persistence and Trace Management
50 min
21Understanding pivoting
45 min
Complete Methodology
22Reproducible Pentest Methodology
50 min
23Complete Pentest Simulation — From Scanning to Report
120 min

Lesson 01

Your First Network Scan — Understanding Before Using Nmap

Understand how network scanning actually works (ports, states, TCP handshake) and learn a clear, documentable Nmap workflow — from host discovery to service enumeration — in an authorized environment.

Scanning & Exploitation - The Offensive Phase/Your First Network Scan — Understanding Before Using Nmap

Why understand before using it

Nmap is the most widely used network scanning tool in the world, both by pentesters and system administrators. It is powerful, precise, and can reveal an impressive amount of information about a target.

The classic trap: using Nmap like a black box. You type a command, information appears, and you move on without knowing:

  • what Nmap actually sent on the network,
  • why a port appears open/closed/filtered,
  • which limitations influence the result (filtering, NAT, segmentation, security policies),
  • how to document a scan so it is defensible in a report.

This lesson follows the reverse path: understand first, then scan.

Beginner Nmap workflow from host discovery to port scanning, version detection, and documentation.

Nmap is not just “a command”: it is a workflow that turns network signals into next steps.

What a port really is

A machine can run multiple services at the same time: web, SSH, database, mail, etc.

For the system to know which service should receive an incoming packet, each service listens on a port number.

  • A port is a logical identifier between 0 and 65535
  • The port is part of the TCP/UDP header
  • The operating system forwards the packet to the process listening on that port

Common examples:

  • HTTP : 80
  • HTTPS : 443
  • SSH : 22
  • MySQL : 3306

What matters to a tester is: which ports are reachable and which services are running behind them.

Open port = reachable service = potential attack surface.

Port = logical identifier (0–65535) used to target a service.

The three port states in Nmap

When Nmap probes a port, it can conclude (simplified):

  • Open: a service responds and accepts traffic.
  • Closed: the machine responds, but no service is listening on that port.
  • Filtered: a network filter (firewall/ACL/IPS/routing) prevents Nmap from clearly observing the state.

Why “filtered” matters:

  • it does not mean “secure”
  • it often means “not observable from your position”
  • it must be explained in your notes/report

Open, Closed, Filtered are the fundamental states to interpret.

TCP: the three-way handshake

To understand a TCP scan, you need to know the handshake:

  1. SYN: “I want to connect”
  2. SYN-ACK: “ok”
  3. ACK: “confirmed, connection established”

A TCP scan is essentially about triggering network responses that let you infer the state of a port.

Nmap is not magic: it observes responses to probes. The quality of your analysis depends on your interpretation.

Installation and verification

On Kali Linux, Nmap is usually already installed.

bash
You type
user@kali:~$ nmap --version
Terminal prints
Nmap version 7.94 ( https://nmap.org )

If you are on Debian/Ubuntu (in an authorized lab):

bash
You type
user@kali:~$ sudo apt install nmap
Terminal prints
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
nmap

Scope and rules before scanning

In a lab, scan your target VM. In a real environment: scan only if you have explicit authorization (scope, testing window, contacts, constraints).

Before your first command, note:

  • authorized IP(s)
  • test objectives (inventory? exposure? versions?)
  • testing window
  • impact constraints (fragile production, maintenance, etc.)
In pentesting, discipline starts before the first command.

Step 1 — Host discovery (inventory)

Goal: identify “who is present” on the authorized segment.

bash
You type
user@kali:~$ nmap -sn 192.168.1.0/24
Terminal prints
Nmap scan report for 192.168.1.1
Host is up (0.00045s latency).
Nmap scan report for 192.168.1.47
Host is up (0.0089s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 2.34 seconds
  • -sn = host discovery without port scanning
  • /24 = address range (adapt to your lab)

Important: some topologies or policies can limit visibility. If a result looks inconsistent, document the limitation instead of jumping to conclusions.

-sn = “host discovery only”.

Step 2 — Port scan (exposed surface)

Once a target is identified, scan its ports to map the exposed surface.

bash
You type
user@kali:~$ nmap 192.168.1.47
Terminal prints
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3306/tcp open mysql

By default, Nmap tests a set of commonly used TCP ports. This is often enough for an initial pass in a lab.

What you should write in your notes:

  • target IP
  • open ports discovered
  • reasonable hypotheses (“SSH + web + exposed database”)
  • next steps (version detection)

Step 3 — Version detection (enumeration)

Once open ports are identified, determine which software is running and which version.

bash
You type
user@kali:~$ nmap -sV 192.168.1.47
Terminal prints
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4
80/tcp open http Apache httpd 2.4.6
3306/tcp open mysql MySQL 5.7.34

Why this is central:

  • a version lets you do documented research (vendor advisories, CVEs, release notes)
  • but a version does not mean “automatically vulnerable”
  • you must correlate with configuration, exposure, and context

-sV = version detection.

Save your results (traceability)

In pentesting, results must be preserved to:

  • make findings reproducible
  • feed the report
  • prove your methodology
bash
You type
user@kali:~$ nmap -sV 192.168.1.47 -oN scan_192.168.1.47.txt
Terminal prints
Nmap scan report for 192.168.1.47
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4

-oN = human-readable output file.

Recommended minimal workflow (simple and clean)

In an authorized lab, keep a clear workflow:

  1. Host discovery (inventory)
  2. Port scan (surface)
  3. Version detection (enumeration)
  4. Notes / log (what you did, what you concluded, what you test next)

The difference between “using Nmap” and “doing a professional scan”: method and documentation.

What Nmap does not do (and what you should not conclude)

  • Nmap does not claim “vulnerable”: it observes signals.
  • Results are relative to your network position.
  • Filtering, segmentation, proxies, NAT, and IPS can change what you see.

A good report mentions:

  • what was observed
  • what could not be observed
  • why (reasonable hypothesis + known limitation)
  • and what that implies for risk
Core command summary
GoalCommandExpected output
Check Nmapnmap --versionNmap version
Host discoverynmap -sn 192.168.1.0/24List of hosts that are up
Port scan (basic)nmap 192.168.1.47Open/closed/filtered ports
Version detectionnmap -sV 192.168.1.47Service + version per port
Save scan outputnmap -sV 192.168.1.47 -oN scan.txtReadable text file
Flashcards
Flashcards
Flashcard

What is a network port?

Flashcard

What does 'filtered' mean in Nmap?

Flashcard

Why is version detection important?

Flashcard

Why should you save Nmap output?

Exercises

Exercise 1

In your lab, perform host discovery on your authorized subnet, then choose an active target and list its open ports.

Exercise 2

Run version detection on open ports and write 5 lines of notes: “what I observed” + “what it implies” + “next step”.

Next Lesson

Now that you can map an exposed surface and enumerate it properly, the next lesson explores stealth and advanced scanning techniques: how to avoid detection, understand firewall filtering, and interpret ambiguous responses. Learn the Nmap flags that separate a loud scan from a silent reconnaissance.

Hands-on challenge

Practice what you learned — run it on your machine.

Do the challenge →

You're on a free lesson

Ready to go further?

Unlock all courses, exercises, real-world scenarios and flashcards — everything to build real skills.

Unlock full access →

No commitment · Cancel anytime

Sign in to track your progress.

Sign in to validate →

22 lessons locked in this course · 800+ students enrolled

$99/year — save 31% vs monthly

Unlock full access →