Beginner Nmap

Nmap for Beginners: Your First Network Scan

Install Nmap, run your first host discovery scan, interpret open ports and service versions, and understand exactly what an attacker sees when they scan your network.

20 min read
6 steps
Updated April 2026
VAPTIC Security Team

Nmap (Network Mapper) is the de facto standard tool for network discovery and security auditing. Every CEH module that involves reconnaissance uses it, and it appears in penetration testing methodologies worldwide. This guide gets you from zero to performing a real service version scan in under 20 minutes — using Kali Linux or any Debian-based system.

Prerequisites
  • Kali Linux (physical, VM, or VAPTIC cloud lab)
  • A target IP or network range you own or have authorisation to scan
  • Basic comfort with a terminal window
01
Step 1

Installing and Verifying Nmap

Nmap is pre-installed on Kali Linux. Verify it's present and check the version — you want 7.9x or later for full NSE script support:

bash
nmap --version Nmap version 7.94 ( https://nmap.org ) Platform: x86_64-pc-linux-gnu

If it's missing (unlikely on Kali), install it:

bash
sudo apt update && sudo apt install -y nmap
02
Step 2

Host Discovery: Finding Live Targets

Before scanning ports, find out which hosts are alive on the network. A ping scan (-sn) sends ICMP echo requests without probing ports — fast and quiet:

bash
# Scan entire /24 subnet — find live hosts only sudo nmap -sn 192.168.1.0/24 Starting Nmap 7.94 ... Nmap scan report for 192.168.1.1 Host is up (0.0012s latency). Nmap scan report for 192.168.1.105 Host is up (0.0034s latency). Nmap scan report for 192.168.1.200 Host is up (0.0021s latency). Nmap done: 256 IP addresses (3 hosts up) scanned in 2.47 seconds
Why sudo?

Most Nmap scan types require raw socket access, which needs root privileges. Always use sudo nmap unless you're doing a basic TCP connect scan (-sT).

03
Step 3

Port Scanning: SYN Scan vs TCP Connect

The default Nmap scan (-sS) is a SYN scan — it sends a SYN packet and never completes the TCP handshake, making it stealthier than a full TCP connect scan:

bash
# SYN scan (default) — scan top 1000 ports sudo nmap -sS 192.168.1.200 PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 443/tcp open https 3306/tcp open mysql 8080/tcp closed http-proxy
Authorisation Required

Port scanning without permission is illegal in most jurisdictions. In VAPTIC labs, your Metasploitable 2 target is pre-authorised. Never scan systems you do not own or have explicit written permission to test.

04
Step 4

Service Version Detection

Knowing a port is open is useful. Knowing what version of software is listening is essential for vulnerability research. The -sV flag probes each open port and attempts to identify the service and its version:

bash
sudo nmap -sV 192.168.1.200 PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0) 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) DAV/2) 3306/tcp open mysql MySQL 5.0.51a-3ubuntu5 8180/tcp open http Apache Tomcat/Coyote JSP engine 1.1
Why this matters

OpenSSH 4.7 from 2008 has multiple known CVEs. Apache 2.2.8 is severely outdated. A real attacker cross-references these versions against the NVD and Exploit-DB immediately. This is exactly what Module 3 of CEH v13 (Scanning Networks) teaches.

05
Step 5

OS Detection and Aggressive Scan

The -O flag enables OS fingerprinting using TCP/IP stack quirks. The -A flag combines version detection, OS detection, script scanning, and traceroute — the all-in-one aggressive mode:

bash
sudo nmap -A -T4 192.168.1.200 OS details: Linux 2.6.24 - 2.6.28 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

The -T4 flag sets timing to "aggressive" — faster scans at the cost of a slightly higher chance of packet loss on congested networks. Use -T3 (normal) in production environments.

06
Step 6

Saving Output for Reporting

In real engagements you need to save results. Nmap supports three output formats — always use -oA to save all three at once:

bash
# Save as .nmap (normal), .xml, and .gnmap (grepable) simultaneously sudo nmap -sV -A -T4 192.168.1.200 -oA scan_results/target_scan # The .xml output can be imported into Metasploit via db_import # The .gnmap output is perfect for grepping specific ports across many hosts grep "22/open" scan_results/target_scan.gnmap
Next Step

Once you have a service version, your next move is to search for exploits. In the next guide, we feed this Nmap output directly into Metasploit using db_import to auto-populate the target database.

Next in the Series
Wireshark Essentials: Capturing and Analysing Traffic
25 min  ·  Beginner
Next Guide
Try It in a Real Lab
Run these exact commands against Metasploitable 2
VAPTIC students access Kali + Metasploitable 2 directly in the browser — no setup, no downloads. CEH Module 3 labs walk through every scan type here.