NMAP
NMAP
```
```
This scan sends ICMP requests to see if a host is up without performing a port scan.
```
nmap <target>
```
Performs a basic scan, checking 1,000 common TCP ports on the target.
```
nmap <target1-target2>
```
Scans multiple IP addresses, either as a range (e.g., `192.168.1.1-254`) or using CIDR notation (e.g.,
`192.168.1.0/24`).
```
```
Scans specific ports, like `-p 1-100`, for a more focused scan.
2. Scan Techniques
2.1 TCP SYN Scan (Default)
```
```
The most popular scan, known as a "stealth scan," as it doesn’t complete TCP connections.
```
```
Performs a full TCP connection, used when SYN scan isn’t available.
```
```
Scans UDP ports to find services like DNS or SNMP. Often used with TCP scan: `nmap -sS -sU
<target>`.
```
nmap -A <target>
```
```
nmap -O <target>
```
Tries to determine the target's operating system.
```
```
```
```
4. Output Options
```
```
```
```
```
```
Outputs results in a `grep`-friendly format for filtering.
```
```
Uses default Nmap scripts for vulnerability detection. You can also specify scripts:
```
```
```
```
5.3 Traceroute
```
```
```
```
Adjusts scan speed, with `-T4` being faster and `-T0` being the slowest (stealthiest).
6. Firewall Evasion and Spoofing
```
```
6.2 Fragmentation
```
nmap -f <target>
```
Fragments packets to bypass firewalls, although this is often detected by modern systems.
```
```
Uses a fake IP address as the source of scan packets (requires root access).
```
```
```
Assumes targets are up without checking, useful for firewalls that block ping.
```
```
```
nmap <target>
```
```
```
```
nmap 192.168.1.0/24
```
```
nmap -p- <target>
```
```
nmap -A <target>
```