Nmap Access Basics
What is Nmap?
Nmap (Network Mapper) is a powerful open-source tool used for network discovery and security auditing. It helps system administrators and security professionals identify devices, services, and potential vulnerabilities within a network infrastructure.
Key Nmap Scanning Techniques
1. Host Discovery
Nmap can detect live hosts on a network using various methods:
## ICMP ping scan
nmap -sn 192.168.1.0/24
## TCP SYN ping scan
nmap -sn -PS22,80,443 192.168.1.0/24
2. Port Scanning Types
Scan Type |
Description |
Command Example |
TCP SYN Scan |
Stealth scan, doesn't complete TCP connection |
nmap -sS target |
TCP Connect Scan |
Full TCP connection |
nmap -sT target |
UDP Scan |
Discovers open UDP ports |
nmap -sU target |
Basic Nmap Command Structure
graph LR
A[nmap] --> B[Scan Type]
A --> C[Host Discovery]
A --> D[Port Selection]
A --> E[Output Options]
Common Nmap Scanning Scenarios
- Basic network inventory
- Security vulnerability assessment
- Service version detection
- Operating system fingerprinting
Example: Comprehensive Network Scan
## Detailed network scan with version detection
nmap -sV -sC -p- 192.168.1.0/24
Security Considerations
While Nmap is a valuable tool, unauthorized scanning can be:
- Illegal without explicit permission
- Potentially detected by intrusion detection systems
- Considered a potential security threat
At LabEx, we emphasize ethical network scanning practices and responsible security testing.
## Timing and performance options
nmap -T4 -n -sV target ## Aggressive timing, no DNS resolution
Key Takeaways
- Nmap is a versatile network scanning tool
- Always obtain proper authorization
- Understand different scanning techniques
- Use responsibly and ethically