Nmap Command
Nmap Command
Nmap Command
-sT nmap 192.168.1.1 -sT TCP connect port scan (Default without root privilege)
-sn nmap 192.168.1.1/24 -sn Disable port scanning. Host discovery only.
-Pn nmap 192.168.1.1-5 -Pn Disable host discovery. Port scan only.
Port Specification
-sV -version- nmap 192.168.1.1 -sV - Intensity level 0 to 9. Higher number increases
intensity version-intensity 8 possibility of correctness
-sV -version- nmap 192.168.1.1 -sV - Enable light mode. Lower possibility of
light version-light correctness. Faster
OS Detection
-O -osscan- nmap 192.168.1.1 -O - If at least one open and one closed TCP port are not
limit osscan-limit found it will not try OS detection against host
-O -max-os- nmap 192.168.1.1 -O - Set the maximum number x of OS detection tries against
tries max-os-tries 1 a target
-T0 nmap 192.168.1.1 -T0 Paranoid (0) Intrusion Detection System evasion
-T1 nmap 192.168.1.1 -T1 Sneaky (1) Intrusion Detection System evasion
-T2 nmap 192.168.1.1 -T2 Polite (2) slows down the scan to use less bandwidth and use
SWITCH EXAMPLE DESCRIPTION
EXAMPLE
SWITCH DESCRIPTION
INPUT
-min-rtt-timeout/max-rtt-timeout/initial-
1s; 4m; 2h Specifies probe round trip time
rtt-timeout <time>
-min-hostgroup/max-
50; 1024 Parallel host scan group sizes
hostgroup <size<size>
-min-parallelism/max-
10; 1 Probe parallelization
parallelism <numprobes>
NSE Scripts
COMMAND DESCRIPTION
Requested scan
(including ping scans)
-f nmap 192.168.1.1 -f use tiny fragmented IP
packets. Harder for
packet filters
SWITCH EXAMPLE DESCRIPTION
nmap -D
Send scans from spoofed
-D 192.168.1.101,192.168.1.102,192.168.1.103,192.168.1.23
IPs
192.168.1.1
Relay connections
nmap -proxies http://192.168.1.1:8080,
-proxies through HTTP/SOCKS4
http://192.168.1.2:8080 192.168.1.1
proxies
Output
SWITCH EXAMPLE DESCRIPTION
-oN nmap 192.168.1.1 -oN normal.file Normal output to the file normal.file
-oX nmap 192.168.1.1 -oX xml.file XML output to the file xml.file
-oG nmap 192.168.1.1 -oG grep.file Grepable output to the file grep.file
-oA nmap 192.168.1.1 -oA results Output in the three major formats at once
-open nmap 192.168.1.1 -open Only show open (or possibly open) ports
nmap -p80 -sV -oG - -open 192.168.1.1/24 | grep Scan for web servers and grep to show which
open IPs are running web servers
ndiff scanl.xml scan2.xml Compare output from nmap using the ndif
COMMAND DESCRIPTION
nmap 192.168.1.1-1/24 -PR -sn -vv Arp discovery only on local network, no port scan
nmap 192.168.1.1 --packet-trace Show the details of the packets that are sent and received
COMMAND DESCRIPTION