Skip to content
Tutorials Center
My learning

Topics

Nmap Tutorial

Learn Nmap step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Nmap? Learn what Nmap is, what it can discover on a network, who uses it and why, and how this course is organized, with runnable Python stand-ins for the ideas.
  2. 2 Installing Nmap Install Nmap on Linux, macOS and Windows, verify the version, understand Npcap and root privileges, and set up a safe home lab target to practice on.
  3. 3 Networking Basics for Nmap Learn the networking ideas behind every scan: IP addresses, ports, TCP flags and the three-way handshake, UDP and ICMP, with runnable Python decoders.
  4. 4 Your First Nmap Scan Run your first Nmap scan against localhost, read what each line of the report means, and try a tiny scanner simulation that prints Nmap-style results.

Scanning Basics

  1. 5 Specifying Targets in Nmap Learn every way to tell Nmap what to scan: host names, IPs, CIDR blocks, octet ranges, target files with -iL, random targets and --exclude, with Python helpers.
  2. 6 Reading Nmap Output Learn to read Nmap's report and save it with -oN, -oX, -oG and -oA, then parse normal and grepable output in Python to turn scans into usable data.
  3. 7 Nmap Port States Explained Understand the six Nmap port states (open, closed, filtered, unfiltered, open|filtered, closed|filtered), what each reply means, and how to interpret them.
  4. 8 Choosing Ports to Scan Control which ports Nmap scans with -p, -F, --top-ports and -p-, mix TCP and UDP port specs, use service names and ranges, and parse port expressions in Python.
  5. 9 Verbosity, Reasons and Packet Tracing See what Nmap is doing and why: -v and -d levels, --reason, --open, --packet-trace, progress and stats, with Python tools to decode reason codes.

Host Discovery

  1. 10 Host Discovery Overview Learn how Nmap decides a host is up, the default discovery probes, ping sweeps with -sn, skipping discovery with -Pn, and when each choice is right.
  2. 11 ARP and Local Network Discovery Learn how ARP works, why Nmap uses it on local networks, how MAC addresses and vendor prefixes are reported, and how to build and read an ARP packet in Python.
  3. 12 Discovery Probes: TCP, UDP and ICMP A tour of Nmap's host discovery probes: ICMP echo, timestamp and mask, TCP SYN and ACK pings, UDP and IP protocol pings, with a packet and checksum builder.
  4. 13 List Scan and DNS Resolution Use the Nmap list scan and DNS options: reverse lookups, -n and -R, custom DNS servers, --system-dns, and a Python reverse-pointer helper to preview targets.

Port Scanning Techniques

  1. 14 SYN and Connect Scans Compare the half-open SYN scan and the full TCP connect scan: how each works, what the target logs, when to choose which, and simulate both handshakes in Python.
  2. 15 UDP Scanning with Nmap Learn how the Nmap UDP scan works, why it is slow and ambiguous, how ICMP rate limiting affects it, and how to combine it with -sV, top ports and timing.
  3. 16 Null, FIN and Xmas Scans Understand how the TCP flag scans -sN, -sF and -sX exploit RFC 793, why they work on some systems and not on Windows, and how to defend against them.
  4. 17 ACK, Window and Maimon Scans Map firewall rules with the Nmap ACK scan, learn what the Window and Maimon scans do, and see how unfiltered and filtered results reveal stateless and stateful filters.

Service and OS Detection

  1. 18 Service and Version Detection (-sV) Learn how Nmap -sV turns an open port into a product name and version: probes, match rules, intensity levels and how to read the results safely.
  2. 19 OS Fingerprinting (-O) Understand how Nmap -O guesses an operating system from TCP/IP behaviour: TTL, window size, options, accuracy and limits, with runnable scoring examples.
  3. 20 Banner Grabbing and Probes See how services announce themselves and how scanners send probes, using small Node.js servers and clients that run only on loopback.
  4. 21 Aggressive Scan (-A) and Traceroute Learn what Nmap -A bundles (-sV, -O, -sC, --traceroute), when to use it on your own network, how traceroute maps hops, and how to read the result.

Nmap Scripting Engine

  1. 22 Introduction to the Nmap Scripting Engine Learn what the Nmap Scripting Engine is, how scripts are written in Lua, how portrule and action work, and how to run your first safe scripts.
  2. 23 Script Categories and Arguments Understand NSE categories such as safe, default, discovery, intrusive and vuln, select scripts with boolean expressions, and pass arguments with --script-args.
  3. 24 Common NSE Scripts for Defenders A tour of useful, low-risk NSE scripts for auditing your own systems: http-title, http-headers, ssl-cert, ssh-hostkey, ftp-anon, dns and banner, with output examples.
  4. 25 Writing NSE Scripts in Lua Learn to write a simple, safe NSE script: metadata, rules, the action function, libraries, return values and testing, with a runnable JavaScript model of the flow.

Evasion, Timing and Ethics

  1. 26 Timing Templates and Performance Tuning Learn Nmap timing templates, parallelism, retries, timeouts and rate limits, how to scan quickly without overloading a network, and how to estimate scan time.
  2. 27 Firewalls, IDS and Evasion Concepts Understand how firewalls and intrusion detection shape scan results, what filtered means, and what Nmap's evasion options are for in authorised testing of your own defences.
  3. 28 Detecting Port Scans in Logs Learn what port scans look like in firewall and server logs, then build a Python detector for horizontal and vertical scans with thresholds, and learn how to respond.
  4. 29 Legal and Ethical Scanning Learn when scanning is allowed, how to get written authorisation, define scope and rules of engagement, avoid harm, and build a scope checker in Python.

Reporting and Automation

  1. 30 Output Formats: Normal, Grepable, XML and More Learn every Nmap output format, when to use -oN, -oX, -oG and -oA, how to append, resume and compare, and how to read each format with small Python programs.
  2. 31 Parsing Nmap XML Output Read Nmap XML with Python's ElementTree: extract hosts, open ports, services and script output, build an inventory table and export CSV and JSON.
  3. 32 Automating Scans and Comparing Results Schedule regular Nmap scans of your own network, compare results with ndiff, detect new open ports and alert on changes, with Python change-detection examples.

Projects and Practice

  1. 33 Project: Build a Network Inventory Turn Nmap scan results into a network inventory: group hosts by role, compare with an asset list, find unknown devices and produce a clear summary, in Python.
  2. 34 Project: A Loopback Port Scanner Build a small TCP connect scanner in Node.js that scans only 127.0.0.1: open, closed and filtered logic, concurrency, timeouts and banner reading, to see how Nmap -sT works.
  3. 35 Project: Write a Scan Report Create a professional scan report from Nmap XML: executive summary, findings with severity, evidence and recommendations, generated as Markdown and HTML with Python.
  4. 36 Nmap Practice Exercises and Cheat Sheet Review Nmap with a compact command cheat sheet, scenario exercises with solutions, a command explainer in Python and a mixed self-test for the whole course.