masscan

fastest asynchronous Internet port scanner

TLDR

Scan single port
$ sudo masscan [192.168.1.0/24] -p [80]
Scan port range
$ sudo masscan [192.168.1.0/24] -p [1-65535]
Scan common ports
$ sudo masscan [192.168.1.0/24] --ports [0-1023]
Scan at specific rate
$ sudo masscan [192.168.1.0/24] -p [80] --rate [10000]
Output to file
$ sudo masscan [192.168.1.0/24] -p [80] -oL [results.txt]
Exclude targets
$ sudo masscan [10.0.0.0/8] -p [80] --excludefile [exclude.txt]

SYNOPSIS

masscan [options] targets

DESCRIPTION

masscan is the fastest Internet port scanner, capable of scanning the entire Internet in under 6 minutes. It uses asynchronous transmission, sending packets without waiting for responses.The tool is designed for large-scale network reconnaissance during authorized security assessments. It produces output similar to nmap for compatibility.

PARAMETERS

-p ports

Ports to scan.
--rate pps
Packets per second.
--banners
Grab banners.
-oL file
List output.
-oJ file
JSON output.
-oG file
Grepable output.
-oX file
XML output.
--excludefile file
Exclude addresses.
--adapter name
Network interface.
-c file
Configuration file.
--wait seconds
Wait after sending.

INSTALL

sudo apt install masscan
sudo dnf install masscan
sudo pacman -S masscan
sudo apk add masscan
brew install masscan
nix profile install nixpkgs#masscan

CAVEATS

Requires root/raw sockets. High rates may overwhelm networks. Only for authorized testing. May trigger IDS alerts. Stateless scanning may miss filtered ports.

HISTORY

masscan was created by Robert David Graham and released in 2013. It was designed to demonstrate that Internet-wide scanning was feasible and to provide a tool for legitimate security research at scale.

SEE ALSO

nmap(1), zmap(1), rustscan(1), unicornscan(1)