# Install masscan on macOS and Linux

Internet-scale TCP port scanner.

masscan is a port scanner built for very large address ranges. It sends packets from its own network stack, fast enough to cover the whole internet. It reports open ports only, so follow it with nmap for detail.

> masscan sends traffic to its target. Only use it on systems you own or have written permission to test.

## How to install masscan

```
ot install masscan
```

ot uses masscan from your system's package manager. If it is not installed yet, ot shows the `winget`, `brew` or `apt` command and asks before running it.

If you do not have ot yet:

macOS and Linux:

```
curl -fsSL https://otinstaller.com/install.sh | sh
```

Windows (PowerShell):

```
irm https://otinstaller.com/install.ps1 | iex
```

Current version: 0.3.0. Both scripts verify the download against its [SHA-256 checksum](https://otinstaller.com/releases/v0.3.0/checksums.txt) before installing.

## How to use masscan

Arguments after the tool's name go straight to masscan.

Scan two ports across a range at 1,000 packets a second.

```
ot run masscan 192.0.2.0/24 -p80,443 --rate 1000
```

Scan the first 1,024 ports and save JSON.

```
ot run masscan 192.0.2.0/24 -p1-1024 -oJ result.json
```

`ot run masscan --help` lists every option.

An AI agent can run masscan too: `ot mcp` serves it over the Model Context Protocol, once the server is started with `--allow-active`. See [OSINT with AI agents](https://otinstaller.com/mcp/).

## masscan licence, platforms and versions

- Project: https://github.com/robertdavidgraham/masscan
- Licence: AGPL-3.0
- Runs on: macOS and Linux
- Takes: ip
- Categories: network, ports
- Sends traffic to the target: yes
- System package: through apk, apt, brew, dnf and pacman

## Questions about masscan

### Does masscan run on Windows?

Not natively. masscan has no Windows build, so ot installs it on macOS and Linux only. On Windows, install ot inside WSL and use masscan from there.

### Is masscan free?

Yes. masscan is open source, released under the AGPL-3.0 licence. ot, which installs it, is free under the Apache 2.0 licence.

### How do I update or remove masscan?

masscan is a system package, so update and uninstall it with your package manager. `ot remove masscan` only makes ot forget it and never uninstalls a system package.

### Do I need permission to use masscan?

Yes, for any system that is not your own. masscan sends traffic to its target, so use it only on systems you own or have written permission to test. ot shows this reminder before the first run, and its MCP server refuses masscan unless started with `--allow-active`.

## Tools related to masscan

- [naabu](https://otinstaller.com/tools/naabu/): Fast port scanner for finding open ports on hosts.
- [nmap](https://otinstaller.com/tools/nmap/): Network mapper for host discovery, port scanning and service detection.
- [asnmap](https://otinstaller.com/tools/asnmap/): Map an organisation, domain or IP to its ASNs and network ranges.
- [cdncheck](https://otinstaller.com/tools/cdncheck/): Identify the CDN, cloud provider or WAF in front of an IP or domain.
- [ipinfo](https://otinstaller.com/tools/ipinfo/): Look up geolocation, ASN, carrier and privacy details for IP addresses.
- [mapcidr](https://otinstaller.com/tools/mapcidr/): Expand, slice and aggregate CIDR ranges and IP lists.

More: [Networks and hosts](https://otinstaller.com/osint-tools/networks/).
