Nmap Deep Notes
Nmap Deep Notes
md 2025-01-06
Introduction to Nmap
Attribute Details
Short History:
Nmap was first released in 1997 and has become one of the most widely used network exploration and
security auditing tools. It helps security professionals assess the status of networks, services, and hosts by
scanning for live devices, open ports, and service versions.
K.H.Patil
1/8
N-MAP.md 2025-01-06
Host Discovery
Specifying Targets
You can specify the target(s) for a scan in the following ways:
Type Example
Subnet 192.168.1.0/24
Example Command:
nmap 192.168.1.0/24
The -sn option performs a ping scan, which only checks for live hosts without scanning ports. The scan uses
different methods depending on the network environment.
Remote Network Sends ICMP Echo Requests, TCP SYN packets to port 443, and TCP ACK packets to
(WAN) port 80 to identify live hosts.
Flag Description
Example Command:
2/8
N-MAP.md 2025-01-06
The -sL option performs a list scan, where Nmap only lists the targets without sending any probes. This can
be useful to check the list of hosts that will be scanned.
Example Command:
Port Scanning
TCP Scans
A Full TCP Connect Scan (-sT) attempts to complete the three-way TCP handshake (SYN, SYN-ACK, ACK) to
detect open ports.
Command Example:
Port Service
22 SSH
80 HTTP
443 HTTPS
21 FTP
25 SMTP
3/8
N-MAP.md 2025-01-06
Port Service
110 POP3
143 IMAP
3306 MySQL
3389 RDP
53 DNS
A SYN Stealth Scan (-sS) sends a SYN packet to the target and waits for a response. If the target is open, it
responds with a SYN-ACK. The connection is never fully established, making it harder to detect.
Command Example:
Port Service
22 SSH
80 HTTP
443 HTTPS
21 FTP
25 SMTP
110 POP3
143 IMAP
3306 MySQL
3389 RDP
53 DNS
UDP Scans
4/8
N-MAP.md 2025-01-06
A UDP Scan (-sU) detects open UDP ports by sending a packet and awaiting a response. Open UDP ports
may respond with a valid message, while closed ports often reply with an ICMP unreachable message.
Command Example:
Port Service
53 DNS
67 DHCP
68 DHCP
69 TFTP
123 NTP
161 SNMP
500 ISAKMP
514 Syslog
33434 Traceroute
By default, Nmap scans the top 1000 ports. You can limit the scan to specific ports using options like -F (fast
scan) or -p (range/specific ports).
Version Detection
5/8
N-MAP.md 2025-01-06
What is it?
Version detection (-sV) allows Nmap to detect versions of services running on open ports. This can help
identify vulnerabilities and misconfigurations.
Why is it useful?
Flag Purpose
Example Command:
Saving scan results is important for record-keeping, further analysis, or generating reports. Nmap provides
several output formats.
Command Examples:
6/8
N-MAP.md 2025-01-06
Advanced Techniques
K.H.Patil
Command Example:
Flag Description
-v Basic verbosity
-d Basic debugging
Command Example:
7/8
N-MAP.md 2025-01-06
Summary Table
Feature Purpose Commands/Flags
Saving Scan Results Stores scan results in reusable formats -oN, -oX, -oG, -oA
K.H.Patil
8/8