Day 8: Nmap Tutorial for Beginners β Complete Network Scanning Guide (2026)

π° Originally published on SecurityElites β the canonical, fully-updated version of this article.

DAY 8 OF 100 100-Day Ethical Hacking Course
π΄ Day 8 β Network Scanning β Nmap Tutorial for Beginners
Day 100 β Professional Pentester
Day 9: Google Dorking & OSINT β
08
Today everything youβve learned so far clicks together into a single workflow. You understand TCP from Day 5. You understand ports from Day 5. You understand subnets from Day 6. You saw packets with Wireshark on Day 7. Now we pick up the tool that uses all of that knowledge simultaneously β and we point it at a target.
Nmap is what reconnaissance actually looks like in practice. By the end of today, youβll run a professional-grade scan workflow on your Metasploitable 2 lab machine and understand every result it returns.
Nmap (Network Mapper) was created by Gordon βFyodorβ Lyon in 1997 and has been actively developed ever since. It is installed on more professional penetration testersβ machines than any other tool. The OSCP exam, every CTF, every real-world assessment β Nmap is the starting point. Understanding it deeply is not optional.
Iβm going to teach you Nmap the way I teach it in professional training: by building from simple host discovery upward to full service enumeration and scripted vulnerability detection. Each layer of complexity builds directly on the previous one. No magic commands you copy-paste without understanding.
π§ͺ
Lab Requirement β Metasploitable 2
Today we scan Metasploitable 2 β a deliberately vulnerable VM. If you havenβt set it up yet, visit our lab setup guide. It runs as a VirtualBox VM on your host-only network alongside Kali. Its IP is typically 192.168.56.101 β confirm with arp -a from Kali after booting it. We scan only within our own lab β never external targets.
π Day 8 Contents
- How Nmap Works β The Basics
- Host Discovery β Finding Live Targets
- Scan Types β SYN, TCP, UDP & More
- Service & Version Detection (-sV)
- OS Fingerprinting (-O)
- NSE Scripts β Beyond Basic Scanning
- Timing & Output Formats
- Reading & Interpreting Results
- Nmap Cheat Sheet
- Day 8 Practical Task
How Nmap Works β What Happens When You Run a Scan
Nmap is fundamentally a packet-crafting and response-reading tool. It constructs specific network packets, sends them to targets, and interprets the responses to draw conclusions about whatβs running. Understanding this at the packet level β which you can now do thanks to Days 5 and 7 β means you understand why different scan types produce different results and have different detectability profiles.
PHASE 1 Host Discovery Which IPs in the range are actually alive? Nmap pings, ARP requests, and TCP probes to find live hosts before scanning ports.
PHASE 2 Port Scanning For each live host, probe ports to determine their state: open, closed, or filtered. Default scans the 1,000 most common ports.
PHASE 3 Service Detection Connect to open ports and probe the service to identify whatβs running and its version. Apache 2.4.29? OpenSSH 7.4? Nmap tells you.
PHASE 4 Script Execution Run NSE scripts against detected services β enumerate users, check for known vulnerabilities, test for misconfigurations.
Phase 1: Host Discovery β Finding Whatβs Alive
Before scanning ports, Nmap needs to know which hosts are alive. Scanning thousands of ports on IP addresses that arenβt even up wastes enormous time. Host discovery is the filter that tells Nmap where to focus its effort.
Host discovery β finding live hosts in your lab
Ping scan β which hosts respond to ICMP?
nmap -sn 192.168.56.0/24 Nmap scan report for 192.168.56.1 Host is up (0.00072s latency). Nmap scan report for 192.168.56.101 Host is up (0.0012s latency). 2 hosts up, 254 scanned in 2.31 seconds
-sn = βscan no portsβ β host discovery only
On a local LAN, Nmap uses ARP by default (more reliable than ICMP)
Skip host discovery β treat all hosts as alive (use for firewalled targets)
nmap -Pn 192.168.56.101
Assumes host is up even if it doesnβt respond to pings
ARP ping only β fastest on local networks
sudo nmap -PR 192.168.56.0/24
Save only the live hosts for later scanning
nmap -sn 192.168.56.0/24 -oG β | grep βUpβ | cut -dβ β -f2 > live_hosts.txt cat live_hosts.txt 192.168.56.1 192.168.56.101
Phase 2: Scan Types β Choosing How to Probe Ports
Different scan types use different techniques to probe ports β each with different speed, reliability, and detectability trade-offs. You need to know what each type actually does at the packet level, because that determines when and why youβd choose it in a real assessment.
Flag Scan Type Root Needed? How It Works When to Use
-sS SYN (Stealth) Yes SYN β SYN-ACK β RST (never completes handshake) Default for authorised scans β fast, reliable, less logged
-sT TCP Connect No Full three-way handshake β uses OS connect() syscall When no root access β slower and more detectable
-sU UDP Yes Sends UDP probes β no response=open|filtered, ICMP=closed Find UDP services: DNS (53), SNMP (161), TFTP (69)
-sA ACK Yes Sends ACK packets β maps firewall rules, not open ports Understanding firewall rules β which ports are filtered vs unfiltered
-sN NULL Yes Sends packet with no TCP flags set Evade some stateless firewalls β unreliable on Windows
π Read the complete guide on SecurityElites
This article continues with deeper technical detail, screenshots, code samples, and an interactive lab walk-through. Read the full article on SecurityElites β
This article was originally written and published by the SecurityElites team. For more cybersecurity tutorials, ethical hacking guides, and CTF walk-throughs, visit SecurityElites.





