tools_syntax_nmap
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools_syntax_nmap [2022/09/24 20:44] – [Port Selection] gman | tools_syntax_nmap [2022/09/25 14:37] (current) – removed gman | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Nmap: Scan Target IPs ====== | ||
- | |||
- | **Usage:** | ||
- | |||
- | < | ||
- | nmap [Scan Type(s)] [Options] {target specification} | ||
- | # need to run as root | ||
- | </ | ||
- | |||
- | **Standard Go-To Examples:** | ||
- | |||
- | < | ||
- | #TCP Ports: | ||
- | nmap -sS -T4 -p- -A [IP Address] | ||
- | |||
- | #UDP Ports: | ||
- | nmap -sU -T4 -A [IP Address] | ||
- | </ | ||
- | |||
- | The following is a list and description of the 30 most common basic commands in nmap (for beginners). | ||
- | * **Source:** [[https:// | ||
- | |||
- | ---- | ||
- | |||
- | ===== Target Selection ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 01 | Scan a single IP | '' | ||
- | | 02 | Scan a host | '' | ||
- | | 03 | Scan a range of IPs | '' | ||
- | | 04 | Scan a subnet | '' | ||
- | | 05 | Scan targets from Text file | '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Port Selection ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 06 | Scan a single port| '' | ||
- | | 07 | Scan a range of ports| '' | ||
- | | 08 | Scan 100 common ports| '' | ||
- | | 09 | Scan all ports| '' | ||
- | | 10 | Specify UDP or TCP scan| '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Scan Types ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 11 | Scan using TCP connect| '' | ||
- | | 12 | Scan using TCP SYN scan| '' | ||
- | | 13 | Scan UDP ports| '' | ||
- | | 14 | Scan Selected ports (Ignore Discovery)| '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Service and OS Detection ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 15 | Detect OS and Services| '' | ||
- | | 16 | Standard service detection| '' | ||
- | | 17 | Aggressive service detection| '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Output Formats ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 18 | Save default output to file| '' | ||
- | | 19 | Save results as XML| '' | ||
- | | 20 | Save formatted results (Grep)| '' | ||
- | | 21 | Save in all formats| '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Scripting Engine ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 22 | Scan using default safe scripts| '' | ||
- | | 23 | Get help for a script| '' | ||
- | | 24 | Scan using a specific script| '' | ||
- | | 25 | Update script database| '' | ||
- | |||
- | ---- | ||
- | |||
- | ===== Some Useful NSE Scripts ===== | ||
- | |||
- | ^ **#** ^ Title ^ Syntax ^ | ||
- | | 26 | Scan for UDP DDOS reflectors| '' | ||
- | | 27 | Gather page titles from HTTP Servers| '' | ||
- | | 28 | Get HTTP headers of web services| '' | ||
- | | 29 | Find web apps from known paths| '' | ||
- | | 30 | Find exposed Netbios servers| '' | ||
- | |||
- | ---- | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== Target Specification ===== | ||
- | |||
- | For the '' | ||
- | * Can pass hostnames, IP addresses, networks, etc. | ||
- | * Examples: scanme.nmap.org, | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | | -iL < | ||
- | |||
- | ---- | ||
- | |||
- | ===== Host Discovery ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | | -sn | Ping Scan - disable port scan | | ||
- | | -Pn | Treat all hosts as online -- skip host discovery | | ||
- | |||
- | ---- | ||
- | |||
- | ===== Scan Techniques ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | | -sS | TCP SYN Port Scan (aka: Half-Open or Stealth Scan) | ||
- | | -sT | TCP Connect Port Scan | ||
- | | -sA | TCP ACK Port Scan | ||
- | | -sW | TCP SYN/ | ||
- | | -sM | TCP SYN/ | ||
- | |||
- | -sU: UDP Scan | ||
- | -sN/sF/sX: TCP Null, FIN, and Xmas scans | ||
- | --scanflags < | ||
- | -sI <zombie host[: | ||
- | -sY/sZ: SCTP INIT/ | ||
- | -sO: IP protocol scan | ||
- | -b <FTP relay host>: FTP bounce scan | ||
- | |||
- | ---- | ||
- | |||
- | ===== Port Specification ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | -p <port ranges>: Only scan specified ports | ||
- | Ex: -p22; -p1-65535; -p U: | ||
- | --exclude-ports <port ranges>: Exclude the specified ports from scanning | ||
- | -F: Fast mode - Scan fewer ports than the default scan | ||
- | -r: Scan ports consecutively - don't randomize | ||
- | --top-ports < | ||
- | --port-ratio < | ||
- | |||
- | ---- | ||
- | |||
- | ===== Service/ | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | -sV: Probe open ports to determine service/ | ||
- | --version-intensity < | ||
- | --version-light: | ||
- | --version-all: | ||
- | --version-trace: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Script Scan ===== | ||
- | |||
- | [[method_3_scanning# | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | -sC: equivalent to --script=default | ||
- | --script=< | ||
- | directories, | ||
- | --script-args=< | ||
- | --script-args-file=filename: | ||
- | --script-trace: | ||
- | --script-updatedb: | ||
- | --script-help=< | ||
- | <Lua scripts> is a comma-separated list of script-files or | ||
- | script-categories. | ||
- | |||
- | ---- | ||
- | |||
- | ===== OS Detections ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | |||
- | -O: Enable OS detection | ||
- | --osscan-limit: | ||
- | --osscan-guess: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Timing & Performance ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | |||
- | Options which take < | ||
- | ' | ||
- | -T< | ||
- | --min-hostgroup/ | ||
- | --min-parallelism/ | ||
- | --min-rtt-timeout/ | ||
- | probe round trip time. | ||
- | --max-retries < | ||
- | --host-timeout < | ||
- | --scan-delay/ | ||
- | --min-rate < | ||
- | --max-rate < | ||
- | |||
- | ---- | ||
- | |||
- | ===== Output ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | -oN/ | ||
- | and Grepable format, respectively, | ||
- | -oA < | ||
- | -v: Increase verbosity level (use -vv or more for greater effect) | ||
- | -d: Increase debugging level (use -dd or more for greater effect) | ||
- | --reason: Display the reason a port is in a particular state | ||
- | --open: Only show open (or possibly open) ports | ||
- | --packet-trace: | ||
- | --iflist: Print host interfaces and routes (for debugging) | ||
- | --append-output: | ||
- | --resume < | ||
- | --noninteractive: | ||
- | --stylesheet < | ||
- | --webxml: Reference stylesheet from Nmap.Org for more portable XML | ||
- | --no-stylesheet: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Miscellaneous ===== | ||
- | |||
- | ^ Switch ^ Description ^ | ||
- | | -6 | Enable IPv6 scanning | | ||
- | | -A | Enable [1] OS detection, [2] version detection, [3] script scanning, and [4] traceroute | ||
- | |||
- | ---- | ||
tools_syntax_nmap.1664052289.txt.gz · Last modified: by gman