Network
Sweep IP ranges for open ports as JSON
Asynchronous masscan port sweep with structured JSON output.
overview
What masscan-json does
masscan-json runs the asynchronous masscan scanner and writes structured JSON instead of a text grid. Set --rate for packets per second, -p for ports, and --range or -iL for targets.
Optional --banners grabs a short service hint. --excludefile keeps out-of-scope addresses out of the sweep. JSON lets a downstream node read host and port as fields.
Trickest runs it as a managed Network node that writes a FILE and FOLDER. Use it as the wide first pass, then hand open ports to a prober. Prefer plain masscan when text output is enough.
use cases
Where masscan-json fits
Sweep a large IP range fast
Scan a full CIDR block or acquired netblock for open ports in one pass, then narrow slower tooling to the hosts that answer.
Feed open ports to a service prober
Emit JSON so a downstream node reads host and port pairs as fields and probes each one for the service behind it.
Grab banners during discovery
Turn on --banners to capture a service hint alongside each open port so triage starts without a second connection per host.
Scope a scan safely
Set --excludefile and a controlled --rate to keep a wide sweep inside the ranges you own and within the network's tolerance.
reference
masscan-json inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| ip-range | STRING | --range | Range of IP addresses to be scanned. |
| targets | FILE | -iL | List of targets. |
| ports | STRING | -p | Port or Port range to be scanned. |
| rate | STRING | --rate | Packets per second. Default: 100. |
| banners | BOOLEAN | --banners | Grab banner information. |
| exclude-file | FILE | --excludefile | Exclude a range of ports. |
| single-source-ip-address | STRING | --source-ip | Provide a separate source ip address. |
Showing key inputs. masscan-json exposes 9 inputs in total.
Full flag reference (9 inputs)
| Name | Type | Flag | Description |
|---|---|---|---|
| rate | STRING | --rate | Packets per second. Default: 100 |
| ports | STRING | -p | Port or Port range to be scanned |
| banners | BOOLEAN | --banners | Grab banner information |
| offline | BOOLEAN | --offline | Test in offline mode |
| targets | FILE | -iL | List of targets |
| ip-range | STRING | --range | Range of IP adresses to be scanned |
| exclude-file | FILE | --excludefile | Exclude a range of ports |
| keep-packets-locally | STRING | --router-mac | Keeps packets on the local network segments so that they won't go out to the Internet. |
| single-source-ip-address | STRING | --source-ip | Provide a separate source ip address |
example
Run masscan-json
# masscan-json: JSON sweep of a documentation netblock for common web portsmasscan 198.51.100.0/24 -p80,443,8080 --rate 1000 --banners -oJ open-ports.json{"ip":"198.51.100.23","port":443,"proto":"tcp","status":"open"}{"ip":"198.51.100.23","port":80,"proto":"tcp","status":"open"}{"ip":"198.51.100.64","port":22,"proto":"tcp","status":"open"}{"ip":"203.0.113.12","port":8080,"proto":"tcp","status":"open"}{"ip":"203.0.113.88","port":443,"proto":"tcp","status":"open"}{"ip":"203.0.113.88","port":80,"proto":"tcp","status":"open"}{"ip":"198.51.100.17","port":8443,"proto":"tcp","status":"open"}guidance
Choosing masscan-json
Use masscan-json for a wide first pass when you need open ports across a large IP range and want JSON fields for the next node. It is a port sweeper, not a service or vulnerability scanner. Pair it with a prober.
masscan
Same scanner with default text output. Use masscan-json when a downstream node needs parseable fields.
massdns
Resolves domains at scale instead of scanning ports. Build the target list, then sweep with masscan-json.
mapcidr
Expands and splits CIDR ranges before this scanner sweeps them.
faq
masscan-json questions
related
More Network tools
asnmap
Map an organization's network ranges from ASN data.
dnsvalidator
Validate public DNS resolvers against trusted baselines.
fping
Parallel ICMP echo sweeps for CIDR ranges and host files.
httprobe
Probe a domain list for working HTTP and HTTPS servers.
httpx
A fast and multi-purpose HTTP toolkit that runs multiple probers with reliable, high-throughput results.
mapcidr
Expand, aggregate, and slice CIDR ranges into host lists.
Run masscan-json yourself
An IP range is expanded by mapcidr, masscan-json sweeps the resulting hosts for open ports, and the open host and port pairs are written as JSON output.
Facts on this page come from the live Trickest tool library.