Skip to content
Back to Blog
·9 min read·technology

Nmap for Network Reconnaissance: A Hands-On Scanning Guide

A practical Nmap guide to host discovery, port scanning, service detection, and NSE scripts for authorised network recon by Indian SMB security teams.

BR

Bachao.AI Research Team

Cybersecurity Research

Scan Your Attack Surface

Security exposure this creates

Unpatched vulnerabilities in your tech stack are the #1 entry point for breaches targeting Indian businesses. Here's what to watch.

Nmap (Network Mapper) is the open-source tool security teams use to discover live hosts, open ports, running services, and software versions on a network they are authorised to test. For Indian SMBs, running Nmap against your own infrastructure is the fastest way to see what an attacker sees before they see it: exposed admin panels, forgotten test servers, outdated services, and misconfigured firewalls. This guide walks through host discovery, port scanning types, service and version detection, NSE scripts, timing controls, and output formats — with authorised-use framing throughout, because scanning any network without written permission is illegal under India's IT Act, 2000.

Why Network Reconnaissance Matters for Indian SMBs

Most SMB breaches don't start with a zero-day exploit. They start with something boring: an open RDP port, an unpatched service still listening on a forgotten subdomain, or a default admin console nobody remembered to close. Reconnaissance with Nmap surfaces exactly this kind of exposure — the low-hanging fruit that attackers scan the entire internet for, automatically, every day.

🛡️
SECURITY
Only run Nmap against assets you own or have explicit written authorisation to test. Scanning third-party networks without consent can violate Section 43 and Section 66 of India's IT Act, 2000. Always keep a signed authorisation letter or statement of work on file before you scan.

Setting Up: Authorised Scope First

Before opening a terminal, define scope in writing: which IP ranges, domains, and time windows are in bounds, who to notify if something breaks, and an emergency stop procedure. This isn't bureaucracy — production scans have crashed fragile IoT devices and legacy print servers. A documented scope protects both the tester and the business. CERT-In publishes periodic advisories on scanning-related incidents and vulnerable configurations that Indian organisations should track alongside their own testing schedule.

nmap -sn 192.168.1.0/24

That single command is host discovery — a "ping sweep" that tells you which of the 254 addresses in that subnet are actually alive, without touching a single port yet.

Host Discovery: Finding What's Actually Live

Host discovery answers the first recon question: what's on this network? Nmap has several discovery techniques because a straight ICMP ping is often blocked by host or network firewalls.

    1. -sn — ping scan only, no port scan. Fast enumeration of live hosts.
    2. -PS — TCP SYN ping on specified ports, useful when ICMP is filtered.
    3. -PA — TCP ACK ping, can slip past stateless firewalls that only block SYN.
    4. -PU — UDP ping, catches hosts that drop ICMP/TCP probes but respond to UDP.
    5. -PR — ARP ping, the most reliable method on a local Ethernet segment.
On an internal LAN, ARP-based discovery is near-100% accurate because ARP can't be routed away or easily filtered. On segmented or cloud-hosted networks, combine methods for reliable coverage.

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

Port Scanning Types: SYN, TCP Connect, and UDP

Once you know what's alive, the next question is what's listening. Nmap supports several scan techniques, each with different trade-offs in speed, stealth, and privilege requirements.

Scan typeFlagHow it worksNeeds root/adminTypical use
TCP SYN scan-sSSends SYN, reads SYN-ACK, never completes handshakeYesDefault, fast, semi-stealthy
TCP Connect scan-sTCompletes full three-way handshakeNoUnprivileged environments
UDP scan-sUSends UDP probes, waits for response or ICMP unreachableYesDNS, SNMP, NTP exposure checks
ACK scan-sASends ACK only, used to map firewall rulesetsYesFirewall rule mapping, not port state
FIN/NULL/Xmas-sF -sN -sXSends unusual flag combinations to evade simple packet filtersYesFirewall/IDS evasion testing
The SYN scan (-sS) is the workhorse — it's fast because it never completes the TCP handshake, and it's the default when Nmap runs with root privileges:
nmap -sS -p- 10.0.0.5

-p- scans all 65,535 TCP ports rather than the default top-1000, which matters because attackers routinely find services running on non-standard high ports specifically to avoid casual scans.

UDP scanning deserves separate attention because it's slower and noisier, but it's where DNS, SNMP, and NTP misconfigurations hide — services that are frequently forgotten during hardening:

nmap -sU --top-ports 100 10.0.0.5
⚠️
WARNING
UDP scans are inherently slow because Nmap must wait for a timeout on non-responding ports, and many firewalls silently drop UDP probes without a rejection, producing false "open|filtered" results. Budget significantly more scan time for UDP than TCP.

Service and Version Detection

Knowing a port is open isn't enough — you need to know what's actually running on it, and which version, because vulnerability research is version-specific.

nmap -sV -sC --version-intensity 5 10.0.0.5

-sV probes open ports with a database of service signatures to identify the application and version. Combined with -sC (the default NSE script set) and -A (aggressive mode, which adds OS detection and traceroute), you get a fairly complete picture of the target in one pass:

nmap -sV -sC -A -p 22,80,443,3389 10.0.0.5

This is typically where an internal team stops — and it's also exactly where the gaps start, because a point-in-time scan only shows what's exposed the moment you run it.

NSE Scripts: Extending Nmap Beyond Port States

The Nmap Scripting Engine (NSE) is what turns Nmap from a port scanner into a lightweight vulnerability and misconfiguration checker. Scripts are organised into categories: auth, default, discovery, intrusive, safe, vuln, and more.

nmap --script vuln -p 443 10.0.0.5

The vuln category checks for known misconfigurations and exposures — expired TLS certificates, weak cipher suites, directory listing, default credentials on common admin panels. The safe category is non-intrusive and won't risk crashing a service, which matters for production scans against fragile legacy systems.

💡
TIP
Run --script safe categories first against production systems, and reserve --script vuln or intrusive categories for staging environments or scan windows explicitly approved by the business owner.

Timing and Stealth: Not Tipping Off Detection Systems

Nmap's timing templates (-T0 through -T5) control how aggressively it paces packets. -T0 (paranoid) sends one probe every five minutes and is used to evade intrusion detection systems during red-team engagements; -T4 (aggressive) is the common default for routine internal scans against systems that can handle the load.

nmap -sS -T3 -p 1-1000 10.0.0.5

Stealth isn't only about speed — fragmenting packets (-f), spoofing the source port (--source-port 53), and randomising scan order (--randomize-hosts) can all help simulate how a real attacker probes a network, which is valuable for testing whether your monitoring actually catches reconnaissance in progress.

graph TD A[Host Discovery] -->|Live hosts found| B[Port Scan SYN TCP UDP] B -->|Open ports| C[Service and Version Detection] C -->|Fingerprints| D[NSE Scripts] D -->|Findings| E[Report and Remediation] style A fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style B fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style C fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style D fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style E fill:#1e3d2f,stroke:#10B981,color:#e2e8f0

Output Formats: Making Scans Usable

Raw terminal output doesn't scale past a handful of hosts. Nmap supports structured export formats that feed into reports, dashboards, or diffing tools to track change over time.

    1. -oN — normal output, human-readable text.
    2. -oX — XML output, the format most automation and reporting tools consume.
    3. -oG — grepable output, useful for quick command-line filtering.
    4. -oA — writes all three formats simultaneously with one base filename.
nmap -sS -sV -oA weekly-scan 10.0.0.0/24

Saving XML output and diffing it week-over-week is a simple, low-cost way to catch configuration drift — a new port that quietly opened, a service that upgraded (or didn't), a host that appeared on the network without anyone provisioning it.

180%YoY rise in breaches starting with exploitation of a vulnerability (Verizon 2024 DBIR)
14%Share of breaches where vulnerability exploitation was the initial access step (Verizon 2024 DBIR)

These figures are drawn from the Verizon Data Breach Investigations Report, the industry's most cited annual breach dataset, and reinforce why continuous discovery of exposed services — not a one-time scan — needs to be part of any SMB's baseline hygiene.

Defensive Detection: Spotting Nmap Scans Against You

Understanding reconnaissance from the defender's side matters just as much as running the scan. SYN scans against a monitored network typically show up as a burst of half-open connections from a single source IP across many destination ports in a short window — a pattern most intrusion detection systems and modern firewalls can flag with connection-rate thresholds. UDP scans against closed ports often trigger a flood of ICMP "port unreachable" responses, another detectable signature.

ℹ️
INFO
Port-scan detection is a baseline control, not a complete defence. Attackers routinely throttle scans below alerting thresholds using -T0/-T1 timing, which is exactly why relying on detection alone — without hardening what's actually exposed — leaves a gap.

Why an External VAPT Catches What Internal Scans Miss

An internal team running Nmap on a schedule is a good habit, but it has structural blind spots. The person running the scan usually already knows the network topology, which unconsciously narrows what they look for. Internal scans are also typically run from inside the corporate network, which means they never see the environment the way an actual external attacker does — from the public internet, against whatever is actually reachable, with no prior knowledge of the architecture.

A proper external VAPT engagement — reconnaissance, vulnerability assessment, and authorised exploitation attempts performed by an independent third party, delivered with a CERT-In empanelled partner where regulatory submission is required — combines Nmap-style discovery with manual verification, business-logic testing, and exploitation validation that automated scanning alone doesn't reach. That combination is what turns a list of open ports into a prioritised, actionable remediation plan.

🎯Key Takeaway
Nmap tells you what's open. It does not tell you what's exploitable, what's business-critical, or what an attacker would actually chain together — that gap is exactly why routine internal scanning and an independent external VAPT are complementary, not interchangeable.
pie title Distribution of Scan Phases in a Typical Engagement "Host Discovery" : 15 "Port Scanning" : 25 "Service and Version Detection" : 25 "NSE Script Analysis" : 20 "Reporting" : 15

A Practical First Scan Checklist

For an SMB security or dev team running their first authorised internal recon pass, a sensible sequence looks like this:

  1. Confirm written authorisation and defined scope.
  2. Run host discovery (-sn) to map live assets.
  3. Run a full-port SYN scan (-sS -p-) against each live host.
  4. Layer in UDP scanning (-sU --top-ports 100) for commonly missed services.
  5. Run service/version detection (-sV) and default NSE scripts (-sC) on open ports.
  6. Save output in XML (-oX) for tracking and comparison over time.
  7. Review findings against a known-good baseline and flag anything unexpected.
Platforms like Bachao.AI build this kind of reconnaissance and vulnerability workflow into an automated, continuous VAPT pipeline, so SMB teams get recon-grade visibility without needing an in-house security engineer running manual Nmap sweeps every week. Dhisattva AI Pvt Ltd built the platform specifically around the gap Indian SMBs face: security tooling that assumes a dedicated security team, when most SMBs don't have one.

Next Steps

Nmap is a foundational skill, not a complete security programme. Used correctly and only against authorised assets, it gives you the same starting visibility an attacker has. Pair routine internal scanning with a periodic external VAPT to catch what a single tool, run from a single vantage point, structurally cannot.

Ready to see what's actually exposed on your network? Get a free VAPT scan, or browse the Bachao.AI blog for more hands-on security guides. If your organisation handles personal data under India's new privacy law, also review our DPDP compliance guide.

Frequently Asked Questions

Is it legal to run Nmap scans in India?
Yes, but only against systems you own or have explicit written authorisation to test. Scanning networks without consent can violate Sections 43 and 66 of India's IT Act, 2000, which cover unauthorised access to computer systems.
What is the difference between a SYN scan and a TCP Connect scan?
A SYN scan (-sS) sends a SYN packet and reads the response without completing the handshake, making it faster and requiring root privileges. A TCP Connect scan (-sT) completes the full three-way handshake, works without elevated privileges, but is slower and more likely to be logged by the target.
Why is UDP scanning slower than TCP scanning?
UDP is connectionless, so Nmap must wait for a timeout when a port doesn't respond, rather than getting an immediate response as with TCP. Firewalls also frequently drop UDP probes silently, adding further delay and ambiguity to results.
Can Nmap scans be detected by a firewall or IDS?
Yes. SYN scans typically produce a burst of half-open connections from one source across many ports, which most modern intrusion detection systems and firewalls can flag using connection-rate thresholds. Slower timing templates like -T0 can reduce detection likelihood but don't eliminate it.
How is Nmap different from a full VAPT engagement?
Nmap performs reconnaissance and can flag some known misconfigurations via NSE scripts, but it doesn't perform manual exploitation, business-logic testing, or risk-prioritised reporting. A VAPT engagement combines automated discovery with manual verification and remediation guidance, typically delivered with a CERT-In empanelled partner where regulatory submission is required.
What NSE script category is safest to run on a production system?
The safe category is designed to be non-intrusive and low-risk for production use. Reserve vuln and intrusive categories for staging environments or scan windows explicitly approved by the system owner, since they can trigger unexpected behaviour on fragile services.
BR

Bachao.AI Research Team

Cybersecurity Research

AI-powered security research and threat intelligence from the Bachao.AI team. Covering the latest vulnerabilities, CVEs, and cybersecurity developments affecting Indian businesses.

Get cybersecurity insights for Indian SMBs

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Find out if you're exposed to this class of threat

Free automated scan — risk score in under 2 hours. No credit card required.

Scan Your Attack Surface
Find your vulnerabilitiesStart free scan →