Skip to main content

NMAP

Scanns networks.

Installation

sudo apt-get update
sudo apt-get install nmap

Basics

ExampleDescription
nmap 192.168.1.1Scan a single IP
nmap 192.168.1.1 192.168.2.1Scan specific IPs
nmap 192.168.1.1-254Scan a range
nmap scanme.nmap.orgScan a domain
nmap 192.168.1.0/24Scan using CIDR notation
nmap -iL targets.txtScan targets from a file
nmap -iR 100Scan 100 random hosts
nmap --exclude 192.168.1.1Exclude listed hosts

Port Scanning

ExampleDescription
nmap 192.168.1.1 -p 21Port scan for port x
nmap 192.168.1.1 -p 21-100Port range
nmap 192.168.1.1 -p U:53,T:21-25,80Port scan multiple TCP and UDP ports
nmap 192.168.1.1 -p-Port scan all ports
nmap 192.168.1.1 -FFast port scan (100 ports)
nmap 192.168.1.1 -p http,httpsPort scan from service name
nmap 192.168.1.1 --top-ports 2000Port scan the top x ports
-O nmap 192.168.1.1 -O 

Performance

nmap 192.168.1.1 -T0  # Paranoid
nmap 192.168.1.1 -T1 # Sneaky
nmap 192.168.1.1 -T5 # Insane

Other

nmap -6 2607:f0d0:1002:51::4 Scanns for IPv6

ExampleDescription
nmap 192.168.1.1 -oN normal.fileNormal output to the file normal.file
nmap 192.168.1.1 -oX xml.fileXML output to the file xml.file
nmap 192.168.1.1 -oG grep.fileGrepable output to the file grep.file