Database schema
Hosts are stored in thehosts table in data/reaper.db.
| Column | Type | Description |
|---|---|---|
id | INTEGER | Primary key, auto-incremented |
ip | TEXT UNIQUE | IP address (unique constraint — one row per IP) |
hostname | TEXT | Resolved hostname |
domain | TEXT | Domain the host belongs to |
os_info | TEXT | Operating system information from Nmap |
mac_address | TEXT | MAC address |
mac_vendor | TEXT | MAC vendor from OUI lookup |
signing | TEXT | SMB signing status: enabled or disabled |
smbv1 | TEXT | SMBv1 status: enabled or disabled |
ports | TEXT | Comma-separated list of open TCP port numbers |
services | TEXT | Comma-separated list of service names |
discovered_at | TIMESTAMP | When the host was last updated |
scan_results table and joined when the API returns host data.
How hosts are populated
Nmap
Full host records including hostname, domain, OS, MAC, ports, and services. Parsed from Nmap XML output and merged with any existing row for that IP.
Masscan
IP and open port numbers only. No hostname or OS data. Useful for rapid large-range discovery.
netexec SMB
Populates hostname, domain, OS, SMB signing status, and SMBv1. Run automatically during SMB scanning and credential capture.
COALESCE(NULLIF(new, ''), existing)).
API endpoints
List all hosts
port_details array joined from scan_results.
Response
The
ports field in API responses is returned as an array of strings (split from the comma-separated database value).Get hosts by type
host_type | Port criteria |
|---|---|
all | All hosts regardless of ports |
windows | Ports: 88, 135, 139, 389, 445, 464, 636, 3268, 3269, 3389, 5985, 5986 |
web | Ports: 80, 443, 8080, 8081, 8082, 8443, 8444, 9443, 10443, 9090, 10000, 50660, 4743, 9582 |
infrastructure | Ports: 22, 23, 2375, 2376, 2325, 6443, 7001, 8001, 9000, 9200, 27017, 6379, 1433, 3306, 5432, 5900 |
scope-unscanned | IPs in scope that have no corresponding host record |
host_type=web, the response also includes a urls array of pre-built scheme://ip:port URLs derived from confirmed-open ports. HTTPS is assumed for ports 443 and 8443; HTTP for all others.
Response
Delete a host
Bulk delete hosts
Import Nmap XML
hosts and scan_results tables. Extracts:
- IP address and hostname (from
<hostnames>or servicehostnameattribute) - Domain (from hostname FQDN split, or
Domain:in Nmapextrainfo) - MAC address and vendor
- OS information (from service
ostypeandproductattributes) - All open TCP ports with service names and versions
status = 'scanned'.
Response
SMB signing and relay targeting
Thesigning column is populated by netexec SMB scans. Hosts with signing = 'disabled' are unsigned SMB relay targets. The SMB Signing Check scan (NETWORK → SMB Signing) populates this column across all scope IPs.
The Hosts table view highlights unsigned hosts so relay targets are immediately visible.
Web port detection and screenshot targeting
The Web Applications filter in the web screenshot module usesGET /api/hosts/by-type/web. This endpoint checks two sources:
scan_resultstable — port/status rows written by Nmap scans (status = 'open')hosts.portscolumn — comma-separated port numbers stored at the host level
hosts.ports) and hosts added via Nmap (which also writes to scan_results) are both matched.
For the web host type, the response includes ready-to-use protocol://ip:port URLs. The screenshot engine uses these directly, skipping any re-probe of ports that are already confirmed open.