NMAP
NMAP
INTRODUCTION TO
NMAP
Nmap (Network Mapper): A free
and open-source utility for network
discovery and security auditing.
2
BASIC HOST DISCOVERY
Command
• nmap -sn 192.168.1.0/24
Explanation:
• -sn: Ping scan - used to discover active devices on a
network without port scanning.
• 192.168.1.0/24: Target network range (Class C
subnet).
3
SIMPLE PORT SCAN
Command
• nmap 192.168.1.1
Explanation:
• Performs a default TCP scan on 1000 common ports
on the target IP address 192.168.1.1.
AGGRESSIVE SCAN
Command
• nmap -A 192.168.1.1
Explanation:
• -A: Enables aggressive scan options including OS detection,
version detection, script scanning, and traceroute.
• Targets the IP address 192.168.1.1.
6
UDP SCAN
Command
• nmap -sU 192.168.1.1
Explanation:
• -sU: Performs a UDP scan on the target IP address
192.168.1.1.
TCP SYN SCAN (STEALTH SCAN)
Command
• nmap -sS 192.168.1.1
Explanation:
• `-sS`: Performs a TCP SYN scan, also known as a
stealth scan, on the target IP address
**`192.168.1.1`**.
7
SCANNING SPECIFIC HOST AND
PORT RANGE
Command:
• nmap -p 1-1000 192.168.1.1
Explanation:
• - `-p 1-1000`: Scans ports 1 to 1000 on the
target IP address `192.168.1.1`.
Explanation:
• - `-T4`: Sets the timing template to 4 (aggressive), making
the scan faster on the target IP address `192.168.1.1`.
SCRIPT SCANNING
Command:
• nmap --script=vuln 192.168.1.1
Explanation:
• `--script=vuln`: Runs vulnerability detection scripts
on the target IP address `192.168.1.1`.
11
DETECTING FIREWALL RULES
Command:
• nmap --script=firewalk --traceroute 192.168.1.1
Explanation:
• `--script=firewalk`: Runs the firewalk script to analyze
firewall rules.
• --traceroute`: Traces the route to the target IP address
`192.168.1.1`.
13
COMBINING SCANNING
Command:
nmap -sS -sU -p 1-1000 -oA scan_results
192.168.1.1
Explanation:
- `-sS`: TCP SYN scan.
- `-sU`: UDP scan.
- `-p 1-1000`: Scans ports 1 to 1000.
- `-oA scan_results`: Outputs results in all formats
(normal, XML, and grepable) to files prefixed
with `scan_results`.
- Targets the IP address `192.168.1.1`.
14
COMBINING OPTIONS
Command
• nmap -sV -O -oN combined_output.txt 192.168.1.1
Explanation:
• -sV: Enables service version detection.
• -O: Enables OS detection.
• -oN combined_output.txt: Saves the results in
normal format to combined_output.txt.
• Targets the IP address 192.168.1.1.
15
OUTPUT TO FILE (NORMAL
FORMAT)
Command
• nmap -oN output.txt 192.168.1.1
Explanation:
• -oN output.txt: Saves the scan results in normal
format to the file output.txt.
• Targets the IP address 192.168.1.1.