Masscan
Mass IP port scanner — the fastest Internet-scale scanner, scanning the entire Internet in minutes
Methods12 commands
#port-scanner#network#masscan#internet-scale#enumeration
Installation
1Install via apt
2Build from source
3Verify installation
# Ubuntu/Debian
sudo apt install masscan
# Build from source
git clone https://github.com/robertdavidgraham/masscan.git
cd masscan && make && sudo make install
# Verify
masscan --versionBasic Usage
Scan large IP ranges for open ports at incredible speeds
# Scan single IP
sudo masscan 192.168.1.1 -p80,443,8080
# Scan subnet
sudo masscan 192.168.1.0/24 -p1-1000 --rate=1000
# Scan from file
sudo masscan -iL ips.txt -p80,443 --rate=10000
# Exclude list
sudo masscan 0.0.0.0/0 -p443 --excludefile exclude.txt
# Banner grabbing
sudo masscan 10.0.0.0/8 -p80 --banners --rate=1000
# Save results
sudo masscan example.com -p1-65535 -oJ results.jsonCommand Reference
12 commands
1Port range to scan
-p2Packets per second
--rate3Grab service banners
--banners4Input file with targets
-iL5File with IPs to exclude
--excludefile6JSON output
-oJ7Binary output
-oB8List output
-oL9Source IP address
--adapter-ip10Source port range
--adapter-port11TTL value for packets
--ttl12Seconds to wait for responses
--waitWhen to Use
1
Scanning entire ASN ranges for open services2
Finding exposed databases and web servers3
Large-scale Internet reconnaissance4
Cloud asset discovery across IP ranges5
Fast initial scan before targeted Nmap scanningNotes & Tips
1
Can scan the entire Internet on a single port in under 5 minutes2
Requires root for raw packet sending3
Use --excludefile to avoid scanning sensitive IPs4
Results can be piped to naabu or nmap for detailed scanningCommon Errors & Solutions
Permission denied
Masscan requires root. Run with sudo on Linux
Adapter not found
Specify network interface with --adapter-ip or --adapter-port