
Nmap remains the foundation of nearly every network security assessment, whether you are mapping an internal environment for a penetration test, validating firewall rules, or building an asset inventory for a security program. Despite dozens of newer tools entering the market, Nmap's flexibility and scripting engine keep it as the starting point for serious network reconnaissance. This walkthrough covers practical, real-world usage from basic host discovery through advanced scripting, the way it actually gets used in professional assessments. Teams at Sagefox Cybersecurity rely on this same workflow as the first step in nearly every internal and external network assessment.
Nmap is available through most package managers and ships with prebuilt binaries for Windows, macOS, and Linux.
sudo apt install nmap
brew install nmapConfirm the installation and check the version, since scripting engine features vary between releases:
nmap --versionBefore running any scan against a live network, it helps to understand what each scan type actually does at the packet level, since this affects both accuracy and how much noise you generate on the target network.
Before scanning individual ports, identify which hosts on a subnet are actually alive.
nmap -sn 192.168.1.0/24This performs host discovery only, without port scanning, which is useful for quickly building an inventory of live systems on a segment.
Many environments block ICMP echo requests at the host or network firewall level, making a standard ping sweep unreliable. Nmap can fall back to TCP-based discovery instead.
nmap -sn -PS22,80,443 192.168.1.0/24This sends TCP SYN packets to common ports as a discovery method, which often succeeds even when ICMP is filtered.
The SYN scan is the default and most commonly used scan type for professional assessments due to its balance of speed and stealth.
sudo nmap -sS 10.10.10.0/24Note that SYN scans require raw socket access, which typically means running with elevated privileges.
Default Nmap scans only check the top 1000 most common ports. For a thorough assessment, scanning the full range is necessary to catch services running on non-standard ports.
nmap -sS -p- 10.10.10.25This scan takes considerably longer, so it is often run separately from initial reconnaissance rather than as a first step.
Nmap's timing templates control how aggressively it sends packets, which directly affects scan duration.
nmap -sS -p- -T4 10.10.10.25Timing templates range from T0 (extremely slow, used for evading intrusion detection) to T5 (extremely aggressive, generally reserved for lab environments with no risk of disruption). T4 is the common choice for professional engagements balancing speed with network stability.
[cta]
Knowing a port is open is only the first step. Identifying what service and version is actually running behind it is what turns a port list into actionable intelligence.
nmap -sV 10.10.10.25For more detailed version probing when the initial pass returns ambiguous results:
nmap -sV --version-intensity 9 10.10.10.25Higher intensity values send more probes, increasing detection accuracy at the cost of scan time.
Operating system detection helps build a fuller picture of the target environment, which matters for prioritizing findings and understanding likely attack surface.
sudo nmap -O 10.10.10.25Combining service detection, OS fingerprinting, and default scripts into a single comprehensive scan is common practice for thorough host profiling:
sudo nmap -A -T4 10.10.10.25The Nmap Scripting Engine extends Nmap far beyond basic port scanning into vulnerability detection, configuration auditing, and even limited exploitation checks. NSE scripts are organized into categories including discovery, vuln, auth, and safe, which helps control what a scan actually attempts against a live target.
nmap -sC -sV 10.10.10.25The -sC flag runs the default script set, which includes safe, non-intrusive checks suitable for most environments including production networks.
For a more focused assessment looking specifically for known vulnerabilities, the vuln category can be called directly.
nmap --script vuln -p 443 10.10.10.25This is significantly more aggressive than the default script set and should be used cautiously against production systems, since some vuln scripts actively attempt to trigger conditions rather than passively check for them.
NSE scripts exist for a wide range of specific checks. For example, checking for SSL/TLS configuration weaknesses on a web server:
nmap --script ssl-enum-ciphers -p 443 10.10.10.25This returns the full list of supported cipher suites and flags weak or deprecated ciphers, which is a common finding in external assessments.
[cta]
For assessments covering many hosts, feeding Nmap a target list rather than a single IP or range keeps scans organized and repeatable.
nmap -sS -sV -iL targets.txt -oA scan_resultsThe -oA flag outputs results in normal, XML, and grepable formats simultaneously, which is useful when results need to feed into other tools or reporting pipelines.
Sometimes specific hosts need to be excluded from a broader scan, such as known fragile legacy systems or out-of-scope assets.
nmap -sS 10.10.10.0/24 --exclude 10.10.10.5,10.10.10.6For larger exclusion lists, a file works better than inline arguments:
nmap -sS 10.10.10.0/24 --excludefile excluded_hosts.txtOnce a scan completes across a large environment, converting the XML output into a readable report matters for actually using the data. Tools like xsltproc can convert Nmap's XML output into an HTML report directly.
xsltproc scan_results.xml -o scan_report.htmlThis produces a browsable report suitable for internal review or as a supporting artifact in a client deliverable.
Firewalls and intrusion prevention systems can silently drop or rate-limit scan traffic, leading to incomplete or misleading results. Comparing scan results from different timing templates or scan types can reveal when this is happening, since dramatically different results between a T2 and T4 scan often point to rate limiting rather than an accurate picture of the target.
Skipping full port range scans in favor of the default top 1000 ports is one of the most common ways real findings get missed. Services running on unusual ports, whether intentionally hidden or simply misconfigured, will never show up in a default scan.
UDP scanning is slow and often skipped due to time constraints, but critical services like DNS, SNMP, and certain VPN protocols run over UDP. A scan that only covers TCP presents an incomplete picture of the actual attack surface.
sudo nmap -sU --top-ports 100 10.10.10.25Automated scan results, including NSE vulnerability scripts, occasionally produce false positives. Manual verification of any critical finding before it goes into a report is standard practice for maintaining credibility with clients, and it is a step that experienced assessors at Sagefox Cybersecurity treat as non-negotiable before anything reaches a final deliverable.
A typical sequence used in professional internal assessments looks like this:
nmap -sn 10.10.10.0/24 -oG live_hosts.txt
nmap -sS -T4 -iL live_ips.txt -oA initial_scan
nmap -sS -p- -T4 -iL live_ips.txt -oA full_port_scan
nmap -sV -sC -iL live_ips.txt -oA service_scan
nmap --script vuln -iL priority_targets.txt -oA vuln_scanThis sequence moves from broad discovery to increasingly targeted and aggressive scanning, which keeps early scans fast while reserving more intensive checks for hosts that warrant closer attention.
Organizations that treat network scanning as a one-time event during an annual assessment miss the drift that happens as new systems get provisioned and configurations change. Scheduling recurring scans, even lightweight discovery and service detection passes, gives security teams ongoing visibility into what is actually running on the network rather than relying on outdated documentation.
Nmap remains a core tool for network visibility because it scales from a quick single-host check to a full enterprise-wide scan sequence without requiring a completely different toolset. The real skill lies in choosing the right scan type, timing, and script combination for the situation, then verifying results manually before treating them as fact. Getting comfortable with the full workflow, from host discovery through NSE scripting, turns Nmap from a basic port scanner into a genuine reconnaissance platform.
If your organization needs a thorough network assessment built on this kind of methodical scanning process, backed by manual verification and clear reporting, the team at Sagefox Cybersecurity can help map your environment and identify what actually needs attention.