Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

429+ Articles
114+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. HOWTOs
  3. Nmap Scanning Techniques for Security Professionals
Nmap Scanning Techniques for Security Professionals
HOWTOIntermediate

Nmap Scanning Techniques for Security Professionals

Master Nmap from basic host discovery to advanced scanning techniques. Covers port scanning, service detection, OS fingerprinting, NSE scripts, and...

Dylan H.

Security Engineering

February 7, 2026
8 min read

Prerequisites

  • Basic TCP/IP networking knowledge
  • Nmap installed (nmap.org)
  • Written authorization for scanning target networks
  • Linux, macOS, or Windows with Nmap

Overview

Nmap (Network Mapper) is the industry-standard tool for network discovery and security auditing. Used by penetration testers, security engineers, and system administrators worldwide, Nmap can discover hosts, identify services, detect operating systems, and find vulnerabilities across networks of any size.

Who Should Use This Guide:

  • Penetration testers performing authorized assessments
  • Security engineers conducting network audits
  • IT administrators inventorying network assets
  • SOC analysts investigating suspicious hosts

Legal Notice: Only scan networks you own or have explicit written authorization to test. Unauthorized scanning may violate computer crime laws.

What You Will Learn:

TechniqueUse Case
Host DiscoveryFind live hosts on a network
Port ScanningIdentify open ports and services
Service DetectionDetermine service versions
OS FingerprintingIdentify operating systems
NSE ScriptsAutomated vulnerability checks
Firewall EvasionBypass basic IDS/firewall rules
Output FormatsGenerate professional reports

Requirements

ComponentDetails
NmapLatest stable (7.95+) from nmap.org
PrivilegesRoot/Administrator for SYN and OS scans
AuthorizationWritten permission to scan target network
NetworkConnectivity to target IP ranges

Installation

# Linux (Debian/Ubuntu)
sudo apt install nmap
 
# Linux (RHEL/CentOS)
sudo yum install nmap
 
# macOS
brew install nmap
 
# Windows — download installer from nmap.org

Part 1: Host Discovery

Before scanning ports, discover which hosts are alive on the network.

Ping Sweep

# ICMP echo + TCP SYN to port 443 + TCP ACK to port 80
nmap -sn 192.168.1.0/24
 
# ICMP only (may be blocked by firewalls)
nmap -sn -PE 192.168.1.0/24
 
# ARP discovery (local network only — most reliable)
nmap -sn -PR 192.168.1.0/24
 
# TCP SYN ping on common ports
nmap -sn -PS22,80,443,3389 10.0.0.0/24
 
# UDP ping (useful when ICMP and TCP blocked)
nmap -sn -PU53,161 10.0.0.0/24

Discovery Options Reference

FlagMethodWhen to Use
-snNo port scan (host discovery only)Initial network mapping
-PEICMP echo requestUnrestricted networks
-PRARP requestLocal subnet only
-PS<ports>TCP SYN pingWhen ICMP is blocked
-PA<ports>TCP ACK pingBypass stateless firewalls
-PU<ports>UDP pingWhen TCP is heavily filtered
-PnSkip discovery (treat all hosts as up)When scanning known-live hosts

Part 2: Port Scanning Techniques

TCP SYN Scan (Default, Recommended)

# SYN scan — fast, stealthy, requires root
sudo nmap -sS 192.168.1.100
 
# Scan specific ports
sudo nmap -sS -p 22,80,443,3389,8080 192.168.1.100
 
# Scan port ranges
sudo nmap -sS -p 1-1024 192.168.1.100
 
# Scan all 65535 ports
sudo nmap -sS -p- 192.168.1.100
 
# Top 100 most common ports (fast)
sudo nmap -sS --top-ports 100 192.168.1.100

TCP Connect Scan

# Full TCP handshake — doesn't require root, but slower and logged
nmap -sT 192.168.1.100

UDP Scan

# UDP scan — slow but essential for finding DNS, SNMP, TFTP
sudo nmap -sU --top-ports 50 192.168.1.100
 
# Combined TCP + UDP scan
sudo nmap -sS -sU --top-ports 100 192.168.1.100

Scan Type Comparison

Scan TypeFlagSpeedStealthRoot Required
SYN Scan-sSFastHighYes
Connect Scan-sTMediumLowNo
UDP Scan-sUSlowMediumYes
FIN Scan-sFMediumHighYes
Xmas Scan-sXMediumHighYes
ACK Scan-sAFastMediumYes
Window Scan-sWFastMediumYes

Part 3: Service and Version Detection

Identify Running Services

# Version detection on open ports
nmap -sV 192.168.1.100
 
# Aggressive version detection
nmap -sV --version-intensity 5 192.168.1.100
 
# Light version detection (faster)
nmap -sV --version-light 192.168.1.100
 
# Version detection + default scripts
nmap -sV -sC 192.168.1.100

Example Output

PORT     STATE SERVICE       VERSION
22/tcp   open  ssh           OpenSSH 8.9p1 Ubuntu 3ubuntu0.6
80/tcp   open  http          nginx 1.24.0
443/tcp  open  ssl/http      nginx 1.24.0
3306/tcp open  mysql         MySQL 8.0.35
8080/tcp open  http-proxy    Apache Tomcat 9.0.83

Part 4: OS Fingerprinting

Detect Operating Systems

# OS detection (requires root)
sudo nmap -O 192.168.1.100
 
# OS detection with version info
sudo nmap -O -sV 192.168.1.100
 
# Aggressive OS detection (more guesses)
sudo nmap -O --osscan-guess 192.168.1.100
 
# Limit OS detection to promising targets
sudo nmap -O --osscan-limit 192.168.1.0/24

Part 5: NSE (Nmap Scripting Engine)

NSE scripts extend Nmap with vulnerability detection, brute force, and enumeration capabilities.

Script Categories

CategoryPurpose
authAuthentication bypass and credential checks
broadcastNetwork broadcast discovery
bruteBrute force password attacks
defaultSafe, useful scripts (-sC)
discoveryService and host information gathering
exploitActive exploitation (use with caution)
safeNon-intrusive information gathering
vulnVulnerability detection
versionVersion detection enhancements

Common NSE Commands

# Run default scripts (safe and useful)
nmap -sC 192.168.1.100
 
# Run all vulnerability scripts
nmap --script vuln 192.168.1.100
 
# Run specific script
nmap --script smb-vuln-ms17-010 192.168.1.100
 
# Run multiple script categories
nmap --script "safe and discovery" 192.168.1.100
 
# HTTP enumeration
nmap --script http-enum -p 80,443,8080 192.168.1.100
 
# SMB enumeration
nmap --script smb-enum-shares,smb-enum-users -p 445 192.168.1.100
 
# SSL/TLS vulnerability check
nmap --script ssl-heartbleed,ssl-poodle,ssl-enum-ciphers -p 443 192.168.1.100
 
# DNS enumeration
nmap --script dns-brute --script-args dns-brute.domain=example.com
 
# Banner grabbing
nmap --script banner -p 1-1000 192.168.1.100

Essential Security Scripts

# Check for EternalBlue (MS17-010)
nmap --script smb-vuln-ms17-010 -p 445 192.168.1.0/24
 
# Check for BlueKeep (CVE-2019-0708)
nmap --script rdp-vuln-ms12-020 -p 3389 192.168.1.0/24
 
# HTTP security headers check
nmap --script http-security-headers -p 80,443 192.168.1.100
 
# FTP anonymous login check
nmap --script ftp-anon -p 21 192.168.1.0/24
 
# SSH authentication methods
nmap --script ssh-auth-methods -p 22 192.168.1.100

Part 6: Output Formats

Save Scan Results

# Normal text output
nmap -oN scan-results.txt 192.168.1.0/24
 
# XML output (for tools like Metasploit)
nmap -oX scan-results.xml 192.168.1.0/24
 
# Grepable output (for scripting)
nmap -oG scan-results.gnmap 192.168.1.0/24
 
# All formats at once
nmap -oA scan-results 192.168.1.0/24
 
# Append to existing file
nmap --append-output -oN existing-scan.txt 192.168.1.100

Part 7: Performance Tuning

Timing Templates

TemplateFlagSpeedAccuracyUse Case
Paranoid-T0Very slowHighestIDS evasion
Sneaky-T1SlowHighIDS evasion
Polite-T2SlowHighProduction networks
Normal-T3DefaultGoodGeneral scanning
Aggressive-T4FastGoodTime-limited assessments
Insane-T5Very fastLowerFast network, lab environments
# Fast scan with aggressive timing
nmap -T4 -F 192.168.1.0/24
 
# Careful scan of production network
nmap -T2 -sV 192.168.1.0/24
 
# Parallel host scanning
nmap --min-hostgroup 64 --min-parallelism 10 10.0.0.0/16

Part 8: Firewall Evasion Techniques

For authorized penetration tests where you need to bypass basic security controls.

# Fragment packets to bypass packet inspection
sudo nmap -f 192.168.1.100
 
# Use decoy addresses (appear to come from multiple sources)
sudo nmap -D RND:10 192.168.1.100
 
# Spoof source port (common bypass for lazy firewall rules)
sudo nmap --source-port 53 192.168.1.100
 
# Custom MTU
sudo nmap --mtu 24 192.168.1.100
 
# Randomize host scan order
nmap --randomize-hosts 192.168.1.0/24
 
# Slow scan to avoid rate-based detection
nmap -T1 --max-rate 10 192.168.1.0/24

Common Scan Profiles

Quick Network Inventory

sudo nmap -sn -T4 -oA network-inventory 192.168.1.0/24

Standard Security Audit

sudo nmap -sS -sV -sC -O -T4 -oA security-audit 192.168.1.0/24

Full Port Comprehensive Scan

sudo nmap -sS -sV -sC -O -p- -T4 -oA full-scan 192.168.1.100

Web Server Assessment

nmap -sV --script "http-*" -p 80,443,8080,8443 -oA web-audit 192.168.1.100

Vulnerability Scan

nmap -sV --script vuln -T4 -oA vuln-scan 192.168.1.0/24

Troubleshooting

IssueCauseFix
"You requested a scan type which requires root"SYN scan needs privilegesUse sudo or switch to -sT
All ports show "filtered"Firewall blocking probesTry different scan types, use -Pn
Scan is very slowLarge network or -T0/-T1 timingUse -T4 or limit port range
OS detection says "too many fingerprints"Not enough open/closed portsScan more ports first with -p-
NSE scripts timeoutTarget rate limitingIncrease --script-timeout value

References

  • Nmap Official Documentation
  • Nmap NSE Script Library
  • Nmap Cheat Sheet — SANS
#Nmap#Network Scanning#Penetration Testing#Security Assessment#Port Scanning#Reconnaissance

Related Articles

OSINT Reconnaissance Methodology for Security Professionals

A structured approach to open-source intelligence gathering covering domain reconnaissance, email enumeration, social media profiling, and infrastructure...

7 min read

Container Security Scanning with Trivy: Images, IaC, and CI/CD

Learn how to use Trivy to scan container images, Dockerfiles, Kubernetes manifests, and Terraform for vulnerabilities and misconfigurations — then integrate it into your GitHub Actions pipeline.

7 min read

HashiCorp Vault: Centralized Secrets Management for Modern Infrastructure

Deploy and configure HashiCorp Vault to securely store, rotate, and audit secrets across your infrastructure — covering installation, auth methods,...

8 min read
Back to all HOWTOs