Skip to content

Run an Authorized Nmap Asset Discovery

Admin
October 4, 2026
7 min read
Intermediate
πŸ’» Target OS: Ubuntu 24.04+ / Windows Server 2025

Before you begin

  • Applies to:Asset inventory on networks the owner has explicitly approved for assessment.
  • Where to start:Start from the approved assessment host and confirm its network vantage point with the owner.
  • What you need:Have the permitted target list, scan window, rate limits, and escalation contact.
Guide tools
Guide tools
0/0 Steps (0%)

An accurate asset inventory helps defenders find unknown devices and confirm that expected services are exposed. Nmap can support that work, but even routine scans create network traffic and can trigger monitoring or affect fragile systems.

Use these commands only for networks and systems you are explicitly authorized to assess. Confirm the target list, scan window, rate limits, and escalation contact with the network owner before starting.


01

Set the Target from the Written Scope

Authorization

Replace the documentation-only example address below with the exact approved CIDR or host list from the engagement record. Keep scope and the unique, private result directory in variables so each command uses the same reviewed target and does not overwrite an earlier scan. Keep this terminal open for the remaining steps. Do not widen the range to adjacent networks.

Terminal window
# Documentation range only: replace after confirming written authorization.
TARGET_CIDR="192.0.2.0/24"
umask 077
RUN_DIR="nmap-results-$(date -u +%Y%m%dT%H%M%SZ)-$$"
mkdir -m 0700 "$RUN_DIR" || { echo 'Result directory already exists; choose a new path.' >&2; exit 1; }
printf 'Approved target: %s\n' "$TARGET_CIDR"
nmap --version
❯ Illustrative Output (Results Vary)
Approved target: 192.0.2.0/24
Nmap version 7.x ...

02

Run Host Discovery and Save the Results

Low-Impact Discovery

A host-discovery scan checks which addresses respond using probes selected by Nmap and the privileges available. Firewalls can suppress replies, so an empty result does not prove that an address is unused. Use a low scan rate and the approved maintenance window.

Terminal window
nmap -sn -T2 --reason -oA "$RUN_DIR/discovery" "$TARGET_CIDR" || exit 1
❯ Illustrative Output (Results Vary)
Nmap scan report for host-a.example (192.0.2.15)
Host is up, received echo-reply ...
Nmap done: 256 IP addresses ...
Nmap low-rate host discovery results limited to the documentation-only 192.0.2.0/24 range

Figure 1: A low-rate Nmap host-discovery run reports responding hosts only within the documentation range.


03

Limit Service Detection to Approved Hosts

Service Inventory

Choose only the hosts and ports listed in the approved plan. This example checks the top 20 ports with a TCP connect scan and light version detection. It does not run scripts or exploit checks; coordinate separately before any broader assessment.

Terminal window
# Example documentation address; replace with an approved host.
TARGET_HOST="192.0.2.15"
nmap -sT -sV --version-light --top-ports 20 -T2 \
--reason -oA "$RUN_DIR/service-review" "$TARGET_HOST" || exit 1
❯ Illustrative Output (Results Vary)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH ...
443/tcp open https ...

04

Compare Findings with the Asset Register

Defensive Follow-Up

Keep all three output formats with the scan record. Reconcile responding addresses and observed services against the CMDB or cloud inventory, then assign unknown assets and unexpected listeners to the responsible team for validation.

Terminal window
ls -l "$RUN_DIR"/discovery.nmap "$RUN_DIR"/discovery.gnmap "$RUN_DIR"/discovery.xml \
"$RUN_DIR"/service-review.nmap "$RUN_DIR"/service-review.gnmap "$RUN_DIR"/service-review.xml
sha256sum -- "$RUN_DIR"/discovery.* "$RUN_DIR"/service-review.* > "$RUN_DIR/scan-output.sha256" || exit 1
sha256sum --check "$RUN_DIR/scan-output.sha256"
❯ Illustrative Output (Results Vary)
nmap-results-20261005T101500Z-12345/discovery.nmap: OK
nmap-results-20261005T101500Z-12345/discovery.gnmap: OK
nmap-results-20261005T101500Z-12345/discovery.xml: OK
nmap-results-20261005T101500Z-12345/service-review.nmap: OK
nmap-results-20261005T101500Z-12345/service-review.gnmap: OK
nmap-results-20261005T101500Z-12345/service-review.xml: OK

Comments