NMAP Full

Nmap Guide

Nmap (Network Mapper) is an open-source utility for network discovery and security auditing. It's considered the de facto standard for network scanning and is an essential tool in any security professional's toolkit.

Core Functionality

Nmap can:

  • Discover hosts on a network

  • Identify open ports on target systems

  • Determine services running on those ports

  • Detect operating systems

  • Probe for vulnerabilities using specialized scripts

  • Map network topologies

Basic Syntax

The general syntax for Nmap is:

nmap [scan type] [options] [target specification]

Scan Types

Host Discovery

Port Scanning Techniques

Service and Version Detection

OS Detection

Timing and Performance

Output Options

Port Selection

NSE (Nmap Scripting Engine)

Common Script Categories

  • default: Default scripts run with -sC

  • discovery: Information gathering scripts

  • safe: Non-intrusive scripts

  • vuln: Vulnerability detection

  • exploit: Exploitation scripts (use with caution)

  • auth: Authentication related scripts

  • brute: Brute force scripts

  • dos: Denial of Service scripts (use with explicit permission only)

Advanced Features

Firewall Evasion

Advanced Host Discovery

Custom Packet Parameters

Practical Examples

Quick Network Sweep

Comprehensive Single Host Scan

Vulnerability Assessment

Low and Slow Scan (Evasion)

Web Server Scan

Service-Specific Scans

SMB/Windows

FTP

SSH

Interpreting Nmap Results

Port States

  • open: Port is actively accepting connections

  • closed: Port is accessible but no application is listening

  • filtered: Firewall/filter is blocking access (no response)

  • unfiltered: Port is accessible but state can't be determined

  • open|filtered: Can't determine if port is open or filtered

  • closed|filtered: Can't determine if port is closed or filtered

Service Detection

Nmap identifies services with varying confidence levels:

  • Service name: ssh

  • Software: OpenSSH

  • Version: 8.2p1

  • Additional info: Ubuntu 4ubuntu0.4

Nmap Optimization Tips

  1. Target wisely: Limit scope to necessary hosts and ports

  2. Use proper timing: Start with moderate timing (-T3 or -T4) and adjust as needed

  3. Be output-conscious: Select appropriate output formats for your use case

  4. Optimize host discovery: Use appropriate discovery methods for your network

  5. Leverage parallel scanning: Multiple hosts can be scanned simultaneously

  6. Consider network conditions: Adjust timing for high-latency links

Ethical Considerations

  • Always obtain proper permission before scanning

  • Consider the potential impact on production systems

  • Avoid aggressive scanning of critical infrastructure

  • Document your activities

  • Follow responsible disclosure for any findings

Nmap is a powerful tool that forms the foundation of most network security assessments. Understanding its capabilities and options allows security professionals to efficiently map networks, identify services, and discover potential vulnerabilities while minimizing impact on target systems.

Last updated