Quickstart:
nmap -sC -sV --top-ports 20 <IP> -o <FILE>
nmap -sC -sV --open --reason <IP> -o <FILE>
Full ports scan:
nmap -sV -sC -p- -O --open <IP> -o <FILE>
Ping sweep:
nmap -sn -PE <IP or Range>
UDP scan:
nmap -sU <IP or Range>
Scan for open ports, determine open services:
nmap --open -sV <IP or Range>
Retrieve a TLS certificate:
nmap -p 443 –script ssl-cert didierstevens.com
Scan and run default scripts:
nmap -sC <IP or Range>
Run a specific script:
# location on Kali: /usr/share/nmap/scripts/
nmap --script <SCRIPT_NAME> <IP>
Skip ping:
nmap -Pn <IP>
Output result to file:
nmap <IP> -o <FILE> # text file
nmap <IP> -oG <FiLE> # greppable file
nmap <IP> -oN <FILE> # nmap file
nmap <IP> -oA <FILE> # all formats