Masscan Guide: High-Speed Network Scanner
Learn Masscan for high-speed network scanning with millions of packets per second, covering options, output formats, and practical scanning examples.
Why You Need Masscan
You need to scan thousands or millions of IPs for open ports — Masscan transmits packets at rates Nmap cannot match, covering the entire IPv4 Internet on a single port in minutes. It is purpose-built for large-scale reconnaissance where speed matters more than stealth.
Prerequisites
How Masscan Works
Asynchronous Scanning: Does not wait for responses before sending next probes.
Randomized Scanning: Scans in random order to avoid detection.
Rate Control: Precise control over packets per second.
Installation
sudo apt install masscan
Basic Usage
sudo masscan 192.168.1.0/24 -p80,443
sudo masscan 192.168.1.0/24 -p1-1000 --rate=1000
Essential Options
| Option | Description |
|--------|-------------|
| -p PORTS | Ports to scan |
| --rate=PPS | Packets per second |
| --banners | Grab banners |
| -oJ FILE | JSON output |
| -oB FILE | Binary output |
| --excludefile | Exclude IP ranges |
Practical Examples
sudo masscan 192.168.1.100 -p0-65535 --rate=10000
sudo masscan 192.168.1.0/24 -p80,443,8080,8443 --rate=5000
sudo masscan 192.168.1.0/24 -p22,80,443 --banners --rate=5000
Output and Conversion
sudo masscan 192.168.1.0/24 -p80 --rate=1000 -oB scan.bin
masscan --readscan scan.bin -oX scan.xml
Rate Setting
Home/Office: 100-1000 pps. Data Center: 10000-50000 pps. Internet: 100000-1000000 pps.
Common Mistakes
Not using rate limiting. Scanning without exclude file. Forgetting root privileges.
Best Practices
Use binary output for resumability. Test rate settings. Combine with Nmap for detailed enumeration.
Related Tools
Related Articles
Summary
Masscan is the fastest port scanner available. Key strengths are speed and Nmap-compatible output. Requires careful rate control.