Masscan requires root privileges (raw sockets). The
sudo_password field is mandatory. Scans are asynchronous — use GET /api/scan-status/{scan_id} to poll completion.POST /api/scans/masscan
Launches a Masscan scan for fast host and port discovery. Results are parsed from Masscan XML output and populated into thehosts table.
Request Body
Scan target. Accepts single IP (
10.10.10.1), CIDR range (10.10.10.0/24), dash range (10.10.10.1-254), or comma-separated list.Port selection preset.
| Value | Masscan flag |
|---|---|
top100 | --top-ports 100 |
top1000 | --top-ports 1000 |
custom | Uses the ports field value |
Explicit port specification when
portPreset is "custom" (e.g. "1-65535" or "80,443,8080").Packets per second. Defaults to
10000. Higher values increase speed but may drop packets on slow links or VPNs.Randomize host scan order (
--randomize-hosts). Defaults to true.Only report open ports (
--open-only). Defaults to true.Sudo password. Masscan requires root for raw socket access.
Response
"success" when the scan was launched.UUID for polling via
GET /api/scan-status/{scan_id}.The Masscan command executed (password redacted).
Recommended workflow
Run Masscan for discovery
Use
top1000 preset with a high rate to quickly find live hosts and open ports across your scope.Run Nmap for service detection
Target the discovered hosts with Nmap (
default or thorough preset) to get service version info, OS fingerprinting, and script output.Output file
Masscan results are written torecon/masscan_<timestamp>.txt and stored in the SQLite scans table. The output file path is returned in the scan status response and linked in the Scan History UI.