Scan a list of targets for Clawdbot gateways that allow unauthenticated access to /tools/invoke. The script posts a gateway tool request and classifies each target based on the HTTP response and payload.
- Bun (the script uses the Bun runtime and
fetch)
bun ./scan-unauth-gateways.ts <targets-file> [--concurrency=N]Examples:
bun ./scan-unauth-gateways.ts ./clawdbot-targets.txt
bun ./scan-unauth-gateways.ts ./shodan.ndjson --concurrency=50The script supports two formats in the same file, one per line:
- Plain text
ip:port - Line-delimited JSON (Shodan-style)
Supported JSON shapes:
- Standard Shodan entries with
ip_strandport - mDNS discovery entries with
mdns.servicesthat include a key containingclawdbot
Results are written to a JSON file next to the input:
- If the input ends with
.json, the suffix is stripped. - Otherwise the full name is kept.
Examples:
targets.json->targets-scan-results.jsonclawdbot-targets.txt->clawdbot-targets.txt-scan-results.json
The output includes:
summarytotals by statusvulnerablelist (statusno_auth)allResultsfull scan results withip,port,status, optionaldetails, andresponseTime
no_auth: Gateway accessible without authentication (vulnerable)auth_required: 401 response, appears correctly protectednot_clawdbot: Target does not look like a Clawdbot gatewayerror: Unexpected response or fetch errortimeout: Request exceeded the 5000ms timeout
The scanner sends:
POST http://<ip>:<port>/tools/invoke
{"tool":"gateway"}
It flags no_auth if it sees:
200with{ "ok": true }404with a tool not found error400witherror.typeoftool_error
- Only scan systems you own or have explicit permission to test.
- Concurrency defaults to 20; increase carefully to avoid rate limits or network noise.