Nmap Basics
What is Nmap?
Nmap (Network Mapper) is a powerful open-source tool used for network discovery and security auditing. It helps cybersecurity professionals and system administrators scan networks, identify active hosts, detect open ports, and assess potential vulnerabilities.
Key Features of Nmap
Nmap provides several essential capabilities for network exploration:
Feature |
Description |
Host Discovery |
Identifies live hosts on a network |
Port Scanning |
Detects open, closed, and filtered ports |
Service/Version Detection |
Determines running services and their versions |
OS Detection |
Identifies operating systems of target machines |
Installation on Ubuntu 22.04
To install Nmap on Ubuntu, use the following command:
sudo apt update
sudo apt install nmap
Basic Nmap Scanning Techniques
Simple Host Scan
nmap 192.168.1.0/24 ## Scan entire subnet
nmap example.com ## Scan domain
Port Scanning Modes
graph TD
A[Nmap Scanning Modes] --> B[TCP SYN Scan]
A --> C[TCP Connect Scan]
A --> D[UDP Scan]
A --> E[Comprehensive Scan]
Example Scan Types
nmap -sS 192.168.1.100 ## Stealth SYN scan
nmap -sV 192.168.1.100 ## Version detection
Best Practices
- Always get proper authorization before scanning
- Use Nmap responsibly
- Understand network and legal implications
At LabEx, we recommend practicing Nmap techniques in controlled, authorized environments to develop cybersecurity skills safely.