scan_id immediately; use GET /api/scan-status/{scan_id} to poll completion. Completed scans are stored in the SQLite scans table and viewable in the Scan History page.
POST /api/scans/nmap
Launches an Nmap scan against a target. Requires a sudo password because Nmap usessudo for OS detection and raw socket access. Results are automatically parsed from the generated .xml file and stored in the hosts and scan_results tables.
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 - Hostname:
dc01.corp.local - Comma-separated IPs (written to file automatically if list is long)
Nmap scan type preset. Defaults to
"default".| Value | Nmap flags |
|---|---|
quick | -T4 -F |
default | -T3 -sV |
thorough | -T3 -sV -sC |
aggressive | -T4 -sV -sC |
custom | Uses custom_params value |
Port selection preset. Defaults to
"custom" (full range or custom).| Value | Ports |
|---|---|
common | 80,443,445,3389,22 |
windows | 88,135,139,389,445,464,636,3268,3269,3389,5985,5986,9389 |
web | 80,8080,8081,8082,443,8443,8444,9443,10443,9090,10000,50660,4743,9582 |
infra | 22,2375,2376,2325,5985,5986,6443,7001,8001,8443,9000,9200,27017,6379,1433,3306,5432,5900 |
all | 1-1000 |
custom | Uses ports field or no port restriction |
Custom Nmap flags used when
preset is "custom" (e.g. -T4 -sV -sC -p 1-65535).Sudo password. Passed to
sudo -S via stdin; never logged or written to disk.Response
"success" when the scan process was launched.UUID identifying the scan record. Use with
/api/scan-status/{scan_id}.The Nmap command that was executed (password redacted).
POST /api/scans/masscan
Launches a Masscan scan for fast host and port discovery. Masscan requires root;sudo_password is mandatory. Results are parsed from the Masscan XML output and populated into the hosts table.
Request Body
Scan target. Accepts the same formats as the Nmap endpoint: single IP, CIDR, range, or comma-separated list.
Port selection preset.
| Value | Masscan flag |
|---|---|
top100 | --top-ports 100 |
top1000 | --top-ports 1000 |
custom | Uses the ports field |
Explicit port specification used when
portPreset is "custom" (e.g. "1-65535" or "80,443,8080").Packets per second. Defaults to
10000. Higher values increase speed but risk dropped packets on slow links.Randomize host scan order (
--randomize-hosts). Defaults to true.Only report open ports (
--open-only). Defaults to true.Sudo password. Masscan requires root access.
Response
"success" when the scan was launched.UUID for polling status.
The Masscan command executed (password redacted).
GET /api/scans
Returns all scan records ordered by creation time (newest first).Response
"success" on success.Array of scan record objects.
GET /api/scan-status/
Polls the status of a specific scan by its UUID. Designed for lightweight polling loops.Path Parameter
The UUID returned by the scan launch endpoint.
Response
Current scan status:
running, completed, failed, killed, error, or not_found.POST /api/scans/kill
Terminates a running scan process by sendingSIGTERM (via pkill) to the matching process. Updates the scan record status to killed.
Request Body
UUID of the scan to terminate.
Response
"success" when the kill signal was sent.Confirmation message including the scan ID.
POST /api/scans/bulk-delete
Deletes multiple scan records from the database by their IDs.Request Body
Array of scan UUIDs (strings) to delete.
Response
"success" on success.Number of records deleted.
POST /api/hosts/import-xml
Imports a previously saved Nmap XML file and populates thehosts and scan_results tables. Accepts a multipart/form-data file upload. This is useful for importing results from scans run outside EtherReaper.
Request
The request must bemultipart/form-data.
An Nmap XML output file (
.xml). Generated with -oX or -oA flags.Response
"success" on success.Number of new host records created.
Number of open port/service records inserted.
Number of existing records left unchanged (deduplication).