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.
Knowledge Check
Frequently Asked Questions
Continue Learning
Nmap Beginner Tutorial: Mastering Network Scanning
Learn Nmap from scratch covering host discovery, port scanning, service detection, NSE scripts, and practical examples.
Tools · BeginnerNetwork Scanning with Nmap for Beginners
A beginner-friendly guide to network scanning with Nmap covering host discovery, port scanning techniques, service detection, and practical scanning examples.
Tools · BeginnerMedusa Guide: Parallel Network Login Auditor
Learn Medusa for parallel network authentication testing with support for multiple protocols, modular design, and practical security assessment examples.
Tools · BeginnerHow to Use Tcpdump: Beginner's Guide to Packet Capture in Kali Linux
Learn how to use tcpdump in Kali Linux — capture packets, filter with BPF, save pcap files and read output, with a worked example and cheat sheet.
Related Security Tools
Masscan
Masscan is an internet-scale port scanner. It can scan the entire Internet in under 6 minutes, transmitting up to 10 million packets per second utilizing asynchronous transmit setups.
Information GatheringRustScan
RustScan is a modern, high-speed port scanner built in Rust that can find all open ports within seconds and automatically pipes them directly into Nmap for deeper script processing.
Information GatheringNmap
Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.
Stress Testinghping3
hping3 is a command-line network tool for crafting, sending, and analyzing custom TCP/IP packets. Built for firewall testing, port scanning, OS fingerprinting, path MTU discovery, and authorized stress testing, it gives you control over nearly every field of the TCP, UDP, ICMP, and raw IP headers — the flags, sequence numbers, window size, TTL, fragmentation, and payload — and then shows you exactly how the target answers. Where Nmap runs predefined scan types, hping3 is the packet workbench you reach for when the question is "what does the firewall do with THIS exact packet?" It runs on raw sockets (so it needs root), supports scan and listen modes, and includes a Tcl scripting engine for automating protocol experiments in a lab.