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 network administrators explore and scan network infrastructures, identify vulnerabilities, and assess network security.
Key Features of Nmap
Nmap provides several essential capabilities for network scanning and analysis:
Feature |
Description |
Host Discovery |
Identify active hosts on a network |
Port Scanning |
Detect open ports and services |
Service/Version Detection |
Determine running services and their versions |
OS Detection |
Identify operating systems |
Security Scanning |
Detect potential vulnerabilities |
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
1. Simple Host Discovery
nmap 192.168.1.0/24 ## Scan entire subnet
nmap example.com ## Scan domain
2. Port Scanning Types
graph TD
A[Nmap Port Scanning] --> B[TCP SYN Scan]
A --> C[TCP Connect Scan]
A --> D[UDP Scan]
A --> E[Comprehensive Scan]
Example Scan Commands
nmap -sS 192.168.1.100 ## Stealth SYN scan
nmap -sV 192.168.1.100 ## Version detection
nmap -O 192.168.1.100 ## OS detection
Best Practices
- Always obtain proper authorization before scanning
- Use Nmap responsibly and ethically
- Keep the tool updated
- Understand network and legal implications
LabEx recommends practicing Nmap in controlled, authorized environments to develop cybersecurity skills safely.