Web API
- GET /config
Returns JavaScript code to set client-side configuration values
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
- Response JSON Object:
config (object) – the configuration values
- GET /(subdb:re:scans|view)/(action:re:onlyips|ipsports|timeline|coordinates|countopenports|diffcats)
Get special values from Nmap & View databases
- Parameters:
subdb (str) – database to query (must be “scans” or “view”)
action (str) – specific value to get (must be one of “onlyips”, “ipsports”, “timeline”, “coordinates”, “countopenports” or “diffcats”)
- Query Parameters:
q (str) – query (including limit/skip and sort)
f (str) – filter
ipsasnumbers (bool) – to get IP addresses as numbers rather than as strings
datesasstrings (bool) – to get dates as strings rather than as timestamps
format (str) – “json” (the default), “ndjson” or “txt”
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server
- Response JSON Array of Objects:
object – results
- GET /(subdb:re:scans|view)/count
Get special values from Nmap & View databases
- Parameters:
subdb (str) – database to query (must be “scans” or “view”)
- Query Parameters:
q (str) – query (including limit/skip and sort)
f (str) – filter
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server
- Response JSON Object:
int – count
- GET /(subdb:re:scans|view|passive|rir)/top/(field: path)
Get top values from Nmap, View, Passive & RIR databases
- Parameters:
subdb (str) – database to query (must be “scans”, “view”, “passive” or “rir”)
field (str) – (pseudo-)field to get top values (e.g., “service”)
- Query Parameters:
q (str) – query (including limit/skip and sort)
f (str) – filter
ipsasnumbers (bool) – to get IP addresses as numbers rather than as strings
datesasstrings (bool) – to get dates as strings rather than as timestamps
format (str) – “json” (the default) or “ndjson”
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server
- Response JSON Array of Objects:
label (str) – field value
value (int) – count for this value
- GET /(subdb:re:scans|view|passive|rir)/distinct/(field: path)
Get distinct values from Nmap, View, Passive & RIR databases
- Parameters:
subdb (str) – database to query (must be “scans”, “view”, “passive” or “rir”)
field (str) – (pseudo-)field to get distinct values (e.g., “service”)
- Query Parameters:
q (str) – query (including limit/skip and sort)
f (str) – filter
ipsasnumbers (bool) – to get IP addresses as numbers rather than as strings
datesasstrings (bool) – to get dates as strings rather than as timestamps
format (str) – “json” (the default) or “ndjson”
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server
- Response JSON Array of Objects:
label (str) – field value
value (int) – count for this value
- GET /(subdb:re:scans|view)
Get records from Nmap & View databases
- Parameters:
subdb (str) – database to query (must be “scans” or “view”)
- Query Parameters:
q (str) – query (including limit/skip and sort)
f (str) – filter
ipsasnumbers (bool) – to get IP addresses as numbers rather than as strings
datesasstrings (bool) – to get dates as strings rather than as timestamps
format (str) – “json” (the default) or “ndjson”
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server
- Response JSON Array of Objects:
object – results
- POST /(subdb:re:scans|view)
Add records to Nmap & View databases
- Parameters:
subdb (str) – database to query (must be “scans” or “view”)
- Form Parameters:
categories – a coma-separated list of categories
source – the source of the scan results (mandatory)
result – scan results (as XML or JSON files)
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer, source or username missing
403 Forbidden – uploads disabled (
WEB_UPLOAD_OKisFalse)404 Not Found – module is not exposed by this server
- Response JSON Object:
count (int) – number of inserted results
- GET /flows
Get a flow graph, count, or details payload.
The query is JSON-encoded under the
qURL parameter and carriesnodes/edgesfilter lists in theflow.Querygrammar plus the pagination / mode knobs listed below.action=detailsreturns details for a single node or edge instead of a graph.- Query Parameters:
q (str) –
JSON-encoded query object. Recognised keys:
nodeslist of node-filter clausesedgeslist of edge-filter clauseslimitcap on returned edges; defaults toconfig.WEB_GRAPH_LIMIT(1000)
skippagination offset; defaults to0modedefault/flow_map/talk_mapcounttruereturns ``{clients, servers,flows}`` instead of the graph
orderbysrc/dst/flow(or unset)timelinetrueembedsdata.meta.timesper edgebefore/after"YYYY-MM-DD HH:MM"time bounds
action (str) –
"details"to fetchhost_details/flow_detailsfor the node or edge id supplied inq.id;q.typeis"node"or"edge".
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – module is not exposed by this server, or
action=detailsand the entity does not exist
- Response JSON Object:
object – results
- POST /flows
Ingest a bulk of flow records.
Mirrors the bulk-insert API documented in
ivre.db.mongo.MongoDBFlow: the request body is a JSON object{"records": [{"kind": "...", ...}, ...]}where each entry carries one of the three ingestion kinds:{"kind": "any", "name": "<zeek-log>", "rec": {...}}maps todb.flow.any2flow(),{"kind": "conn", "rec": {...}}maps todb.flow.conn2flow(),{"kind": "flow", "rec": {...}}maps todb.flow.flow2flow().
Records are dispatched in order, then a single
db.flow.bulk_commit()flushes the bulk. Returns{"count": <records-ingested>}.- Status Codes:
200 OK – no error
400 Bad Request – invalid referer or malformed body
403 Forbidden – uploads disabled (
WEB_UPLOAD_OKisFalse)404 Not Found – module is not exposed by this server
- Response JSON Object:
count (int) – number of records ingested
- POST /flows/cleanup
Run the backend’s
cleanup_flowsheuristic.The handler dispatches to the configured backend’s
cleanup_flows()(a no-op on the SQL backend until the host-swap heuristic is ported); the response carries no body besides{"status": "ok"}so theivre.db.http.HttpDBFlowclient can treat any non-2xx as an error.- Status Codes:
200 OK – cleanup completed
400 Bad Request – invalid referer
403 Forbidden – uploads disabled (
WEB_UPLOAD_OKisFalse)404 Not Found – module is not exposed by this server
- GET /ipdata/(addr)
Returns (estimated) geographical and AS data for a given IP address.
- Parameters:
addr (str) – IP address to query
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
- Response JSON Object:
object – the result values
- GET /passivedns/(query: path)
Query passive DNS data. This API is compatible with the Common Output Format and implemented in CIRCL’s PyPDNS.
It accepts two extra parameters, not supported (yet?) in PyPDNS:
subdomains: if this parameter exists and a domain name is queried, records for any subdomains will also be returned.
reverse: if this parameter exists and a domain name is queried, records pointing to the queried domain (CNAME, NS, MX) will be returned.
It also returns additional information:
“sensor”: the “sensor” field of the record; this is useful to know where this answer has been seen.
“source”: the IP address of the DNS server sending the answer.
- Parameters:
query (str) – IP address or domains name to query
- Query Parameters:
subdomains (bool) – query subdomains (domain name only)
reverse (bool) – use a reverse query (domain name only)
type (str) – specify the DNS query type
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – passive module is not exposed by this server
- Response JSON Object:
object – the result values (JSONL format: one JSON result per line)
- GET /passive
Get records from Passive database
- Query Parameters:
q (str) – query (only used for limit/skip and sort)
f (str) – filter
ipsasnumbers (bool) – to get IP addresses as numbers rather than as strings
datesasstrings (bool) – to get dates as strings rather than as timestamps
format (str) – “json” (the default) or “ndjson”
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – passive module is not exposed by this server
- Response JSON Array of Objects:
object – results
- GET /passive/count
Get special values from Nmap & View databases
- Query Parameters:
q (str) – query (only used for limit/skip and sort)
f (str) – filter
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – passive module is not exposed by this server
- Response JSON Object:
int – count
- GET /dns
Return a merged DNS view across the active scan database (
db.nmap) and the passive observation database (db.passive).Each result is a pseudo-record keyed on
(name, addr): a single row aggregates every observation of that pair across both backends, withcountbeing the sum of the per-source counts (rec['count']on the passive side, one per matching nmap document on the active side).typesandsourcesare unions of the contributing backend values (e.g.["A", "PTR", "user"],["sensor1", "scan-2024-Q1"]);firstseen/lastseenextend the union of the contributing intervals.Results are sorted
lastseendescending, thencountdescending. The user’sq=filter is applied to both backends — tokens that are meaningful only on one side (e.g.recontype:on passive,port:on nmap) are silently dropped on the other via the standardhasattr(dbase, "searchXXX")gate inflt_from_query.Note: the merge happens in-process; every contributing record is materialised before sorting and pagination. The server-side
MONGODB_QUERY_TIMEOUT_MScap bounds the worst-case request time. For deployments where this matters, a future change can introduce a materialised summary collection updated at ingest time.- Query Parameters:
q (str) – query (filter, plus
skip,limitmeta-params)datesasstrings (bool) – emit ISO-ish date strings rather than Unix timestamps
format (str) –
"json"(default) or"ndjson"
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – dns module is not exposed by this server
- Response JSON Array of Objects:
object – pseudo-records as
{name, addr, count, firstseen, lastseen, types, sources}
- GET /rir
Get records from the RIR database.
Records are sorted narrowest-first by default (most-specific inet[6]num allocation at the top), so a
host:/net:/range:filter naturally surfaces the leaf record covering the queried address.aut-numrecords (no range, nosize) sort to the end. Pass?sortby=<field>(or?sortby=~<field>for descending) to override.- Query Parameters:
q (str) – query (only used for limit/skip and sort)
f (str) – filter
format (str) – “json” (the default) or “ndjson”
sortby (str) – optional sort field; default is
sizeascending thenstartdescending thenstopascending (narrowest range first)
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – rir module is not exposed by this server
- Response JSON Array of Objects:
object – results
- GET /rir/count
Count records from the RIR database.
- Query Parameters:
q (str) – query (only used for limit/skip and sort)
f (str) – filter
- Status Codes:
200 OK – no error
400 Bad Request – invalid referer
404 Not Found – rir module is not exposed by this server
- Response JSON Object:
int – count
- GET /auth/check
When auth is disabled, allow all requests.