Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

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.

Nmap, short for Network Mapper, is a free, open-source tool that discovers what is on a network. You point it at one computer, a range of addresses or a whole subnet, and it tells you which machines are alive, which network ports are open on them, which services are listening behind those ports, and often which operating system they run. Gordon "Fyodor" Lyon released it in 1997, and it has been maintained ever since. Today it is one of the most widely used tools in networking and security.

This lesson explains what Nmap does, why people use it, and what you will learn in the course. Nothing in this lesson needs a network: the examples are small Python programs that model the ideas.

What runs on this site. Nmap itself is a native program that sends raw network packets, so it cannot run in your browser. Every nmap command in this course is shown in a read-only block with realistic, labelled example output (invented hosts in the documentation address ranges 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24). The runnable editors are Python stand-ins that parse output, build packets or simulate scan logic. They never touch a real network.

What Nmap answers

A network is a set of devices that can talk to each other. When you manage one, or secure one, you keep asking the same questions:

  • Which devices are connected right now?
  • Which of them accept connections, and on which ports?
  • What software answers on those ports, and which version is it?
  • Did anything change since last week?

Nmap answers these by sending carefully chosen packets and interpreting the replies. A reply, a refusal or silence each carries meaning, and Nmap turns them into a readable report.

TEXT
$ nmap 192.0.2.10
Starting Nmap 7.9x ( https://nmap.org ) at 2026-11-12 10:00 UTC
Nmap scan report for 192.0.2.10
Host is up (0.0021s latency).
Not shown: 997 closed tcp ports (reset)
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 1.42 seconds

Example output (invented host). In seven lines you learn that the machine is up, that three ports accept connections, and that 997 other ports refused them.

The main jobs of Nmap

What Nmap can do

Host discovery Which devices are alive?
Port scanning Which ports are open?
Service detection Which software and version?
OS detection Which operating system?

These four are the core of every scan.

1 / 2
  1. Host discovery (sometimes called a ping sweep) finds live hosts in a range. You will study it in Host Discovery Overview.
  2. Port scanning checks which TCP and UDP ports respond. Chapter 4 covers the scan types.
  3. Service and version detection talks to open ports to identify the software.
  4. OS detection compares how a machine answers unusual packets with a database of known systems.
  5. The Nmap Scripting Engine (NSE) runs small Lua scripts for tasks such as checking certificates, reading banners or testing for known weaknesses.

Who uses Nmap, and why

  • System and network administrators keep an inventory, check that firewalls behave as designed, and find forgotten servers.
  • Security teams and penetration testers (with permission) map the attack surface of a network before assessing it.
  • Developers and DevOps engineers confirm that only the intended ports are exposed after a deployment.
  • Students and hobbyists learn how TCP, UDP and ICMP behave on a home lab.

The same facts that help a defender also help an attacker, which is why the next chapter's lessons on legal and ethical use matter. The rule of this course: scan only what you own or have written permission to test.

The shape of a scan

Every Nmap run follows roughly the same pipeline. Some phases are optional and you can switch them on or off with options.

flowchart LR
  A["Targets<br/>(addresses, names, ranges)"] --> B["Host discovery"]
  B --> C["Port scan"]
  C --> D["Service / OS detection"]
  D --> E["Scripts (NSE)"]
  E --> F["Report"]

Figure: the phases of an Nmap scan. Each arrow can be skipped or tuned with options.

A stand-in: turning scan output into data

Real work with Nmap often means reading its output with a program. Here is a first stand-in that parses the text report above into a Python dictionary. The text is a fixed, invented sample; nothing is scanned.

Python Parse a sample Nmap report

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You will build a fuller parser in Reading Nmap Output. For now notice the three-column layout PORT STATE SERVICE: you will meet it in every scan.

A stand-in: what a "scan" really decides

Under the hood, a port scan is a classification problem: given what came back (or did not), pick a state for the port. This tiny function models the idea with plain strings instead of packets.

Python Classify a probe result

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The real states are slightly richer (open|filtered, unfiltered and more), and Port States Explained covers them one by one.

How this course is organized

  1. Getting Started: install, law and ethics, networking basics, your first scan.
  2. Scanning Basics: targets, output, port states, port selection, verbosity.
  3. Host Discovery: finding live hosts, ARP, probe types, DNS.
  4. Port Scanning Techniques: SYN, connect, UDP, and the stealthier flag scans.
  5. onward: service and OS detection, NSE, evasion and timing, reporting and projects.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the name Nmap stand for?

    Nmap is short for Network Mapper: it discovers and maps hosts, ports and services.
  2. 2. Which of these is NOT a core job of Nmap?

    Nmap observes and probes; it is not a VPN or encryption tool.
  3. 3. You find an interesting server on the internet that you do not own. What is the correct way to treat it?

    Scanning systems you do not own or have permission to test can be illegal or violate acceptable-use rules.
  4. 4. Why can't the commands in this course run in your browser?

    Browser pages cannot send raw TCP, UDP or ICMP packets, so commands are read-only and the editors use stand-ins.

Summary

  • Nmap (Network Mapper) discovers hosts, open ports, services and operating systems.
  • Administrators, developers, testers and learners use it; permission is always required.
  • A scan is a pipeline: targets, discovery, port scan, detection, scripts, report.
  • A port's state is decided from the reply (or silence) to a probe.
  • On this site, Nmap commands are read-only with labelled example output; the runnable code is Python stand-ins.

Next: Installing Nmap