Masscanfor Linux, macOS, Windows
High-speed asynchronous port scanner for large IP ranges.
- Open source
- AGPLv3 license
- By Robert Graham
Scan and capture only on networks you own or have written permission to assess. Read the authorization checklist.
Masscan overview
Masscan is the tool you reach for when the scan you need is simply too big for anything gentler. Written by Robert Graham, it’s an open-source port scanner built around one idea: transmit probes asynchronously so the scan isn’t bottlenecked waiting for replies. The result is a scanner that can sweep enormous address ranges at a speed that genuinely surprises people the first time. That power is real, and so is the responsibility — this is a tool that can flood a network as easily as survey it, and it belongs in experienced hands.
In large corporate networks, Masscan addresses a problem that conventional scanners struggle with: scanning a wide address space in a timeframe that is actually useful. When a security team needs to verify that a particular port is closed across every subnet after an emergency patch, or an admin needs to find every instance of an exposed service across a sprawling enterprise, Masscan delivers answers in minutes rather than hours. That speed is what makes it practical for time-sensitive troubleshooting at scale.
What Masscan actually does
Masscan does one thing: it finds open ports across a range of IP addresses, fast. It sends probes out and collects responses independently rather than checking one host, waiting, and moving on. That asynchronous design is why it can cover ranges that would take a conventional scanner an impractically long time.
Its command-line syntax deliberately echoes Nmap, so if you already know Nmap the basics feel familiar — you specify ranges, ports, and rate. Crucially, you control the transmit rate, and cranking it up is what unlocks the speed. It outputs to formats you can pipe into other tools, which fits how it’s actually used: as the fast first pass that tells you where to look, before a more careful scanner tells you what’s there. It’s distributed as source you build yourself, which is normal for this kind of utility but worth knowing before you start.
How administrators use it
Emergency port sweep after a vulnerability disclosure. A critical CVE drops affecting a service on port 8443. The security team needs to know which hosts across dozens of subnets expose that port. Masscan sweeps the entire corporate range for port 8443 in minutes, producing a list of affected IPs that the patching team can act on immediately — a job that would take a conventional scanner hours.
Validating firewall rules at scale. After a firewall migration, the network engineer needs to confirm that ports which should be closed are actually closed across every production subnet. Masscan scans the full range for the blocked ports at a controlled rate and exports the results. Any unexpected open port means a rule was missed — caught before an attacker finds it.
Baseline scan of a newly acquired network. The company acquires a subsidiary and inherits its network with no documentation. Before connecting it to the corporate backbone, the security team runs Masscan across the entire range to find every open port, then feeds the results into Nmap for service identification. The output becomes the initial asset and exposure map.
Periodic perimeter audit. Once a quarter, the admin runs Masscan against the organization’s public IP ranges to check for services that should not be internet-facing. The results are diffed against the previous quarter’s scan — any new open port is investigated before the next change window.
Where it shines
Raw speed and scale are the entire point, and it delivers. If your job is to answer “across this very large range, which hosts have port 443 open,” Masscan will tell you far faster than the alternatives. For internet-scale research, large enterprise sweeps, or any situation where the address space is huge, nothing gentler keeps up.
It’s also lean and focused. It doesn’t try to do service detection, scripting, or reporting — it finds open ports and gets out of the way, which makes it a clean building block in a larger pipeline. The Nmap-like syntax lowers the learning curve for anyone already in that world, and being open source means you can read exactly what it does and build it for your platform.
Where it falls short
The flip side of the speed is danger. At high transmit rates Masscan can saturate links, overwhelm fragile devices, and set off every intrusion-detection alarm in the building. Used carelessly it looks exactly like an attack, because operationally it behaves like one. This is not a tool to point at a network casually or to hand to someone still learning.
It’s also narrow by design. It finds open ports and little else — no version detection, no OS fingerprinting, no scripting engine. You’ll still want Nmap or another tool for the detail. It’s Linux-oriented, typically built from source, and expects comfort with the command line and networking fundamentals; there’s no friendly GUI to cushion mistakes. And because misuse is so easy, the authorization bar is higher here than for almost any other scanner in this catalog.
Who it’s for
Security researchers, penetration testers, and network engineers who genuinely need to scan large scopes and understand exactly what a high packet rate does to a network. In experienced hands it’s superb. For a small-office admin doing routine inventory, it’s overkill and easy to misuse — a lighter, safer tool will serve you better and won’t risk knocking things over.
Licensing and cost
Masscan is open source, distributed under the GNU Affero General Public License version 3 (AGPLv3), and free to use under that license’s terms. The AGPL carries obligations if you modify it and offer it as a network service, so if you’re building on top of it, read the license before you ship.
How it compares — real alternatives
The natural companion is Nmap: Masscan finds open ports fast across a huge range, then Nmap investigates the interesting hosts in depth with service and OS detection. They’re complementary, not rivals — many workflows run both. At the other end of the spectrum, if your needs are modest, a graphical tool like Angry IP Scanner or the Windows-friendly Advanced IP Scanner will do routine discovery without the speed, the risk, or the build step. Choose Masscan only when the scale of the job actually calls for it.
Getting it safely
Masscan lives on GitHub, under Robert Graham’s account (github.com, robertdavidgraham/masscan) — we host nothing and simply point you to the project’s own repository. Getting it from the official repo, rather than a random mirror, is how you know you’re building the real thing; it’s worth understanding how to verify what you download in general. Given how readily Masscan can be mistaken for — or turned into — an attack, run it only against networks and ranges you own or have explicit, documented authorization to scan, and keep the rate sane. If there’s any doubt, start with the authorization checklist.
How to verify what you got. Clone only from the official GitHub repository (github.com/robertdavidgraham/masscan). Before building, verify the commit is signed or matches the latest tagged release: run git tag -v on the release tag if GPG signatures are available, or at minimum confirm the commit hash matches what GitHub shows for that tag. After building, run ./masscan --version and check the version string matches the release you cloned. Do not use pre-compiled binaries from third-party sites — building from the verified source is the only trustworthy route for a tool this powerful.
FAQ
Why is Masscan so much faster than a normal scanner? It sends probes asynchronously instead of waiting for each reply before moving on, and it lets you set a high transmit rate. That decoupling is what allows it to cover very large ranges quickly — and also why a careless rate can overwhelm a network.
Should I use Masscan instead of Nmap? Usually alongside it, not instead. Masscan is the fast first pass that finds open ports at scale; Nmap is the follow-up that tells you what’s actually running on them. For small networks, Nmap alone is often plenty.
Is it safe to run on my office network? Only if you own it or are authorized, and only at a rate the equipment can handle. High-rate scans can disrupt services and trigger security alerts, so treat Masscan with more caution than a lightweight discovery tool.