# Caprun – Single-binary Rust security stack and 3 consumer forks

> Source: <https://github.com/Aeorsyn/caprun>
> Published: 2026-12-02 23:54:21+00:00

**Key takeaway:** Caprun routes high-anomaly flow summaries and STDP spikes to a local llama-server on port 8080 or Ollama on port 11434 for automated threat verdicts that can trigger XDP source-IP drops.

`caprun` is a self-hosted Rust network telemetry, active defense, privacy routing, and on-demand micro-app suite built around an **12-tab Web OpsDeck (`:8095`)**. It combines **eBPF/XDP** wire-speed capture and **Vulkan WGSL** GPU compute with **WireGuard**, a **Tor Onion Router + Hardened Browser**, **local AI/STDP detectors**, **Sentinel Shield**, and **AppForge** (zero-byte ephemeral micro-apps).

- **eBPF / XDP Native Hook (`wlo1`):** Line-rate packet inspection and kernel-level dropping before traffic reaches the Linux stack.
- **Arm XDP Drop & XDP Enforce:** Toggle between passive logging and active enforcement to drop flagged source IPs automatically when threat scores cross threshold.
- **Prism Live Flow Engine & Wire Sniffer:** Real-time flow tracking with byte/packet counters, SNI hostnames, protocol breakdowns, and passive wire sniffing.
- **TLS Keylog Inspector (`SSLKEYLOGFILE`):** Reads NSS TLS session keys to inspect local TLS flows without MITM root certificates.
- **JA4+ & Stego Fingerprinting (`src/ja4.rs`, `src/ja4_stego.rs`):** Computes JA4 client/server fingerprints to identify tools and beacons, paired with GPU LSB steganography payload checks.

- **Real-Time Host-to-Host Mapping:** Renders active LAN and external endpoints as an interactive force-directed connection graph from live XDP/Prism flows.
- **Traffic Cluster & Beacon Visibility:** Surfaces chatty IoT devices, sudden fan-out scans, unexpected outbound connections, and peer-to-peer edges at a glance.
- **Flow Drill-Down:** Inspect node metadata, protocols, ports, and flow volume directly from the graph to isolate anomalies fast.

- **Flood-Proof History:****Infinite Scroll** toggle buffers up to**10,000 deduplicated events** in RAM, loading older batches of 100 rows on scroll so 10-second traffic floods never push hits off-screen.
- **Refind & Freeze Controls:** Substring search across IPs, ports, domains, and tags, plus**Freeze / Resume** to lock the viewport while capture continues.

- **Intel Iris Xe Vulkan Dispatch (`wgsl/`):** Submits parallel WGSL compute shaders to the local GPU for keyspace sweeps, payload analysis, LSB steganography scans, and audio FFT processing.

- **Local Tor SOCKS5 Proxy (`127.0.0.1:9150`):** Tor daemon control, live exit relay directory, circuit rotation (`SIGNAL NEWNYM` ), and local`.onion` hidden service hosting.
- **OnionRadar Leak Monitor:** Watches live traffic for DNS leaks, non-proxied UDP/STUN leaks, and probes; includes**Auto-Rotate** (`SIGNAL NEWNYM` , max once per 30s) on high-severity alerts (`>= 55` ).
- **1-Click Hardened Browser Launcher:** Spawns an isolated Chromium or Firefox profile locked to`socks5h://127.0.0.1:9150` with WebRTC non-proxied UDP and QUIC disabled for leak-hardened`.onion` and anonymous browsing.

- **WireGuard Tunnel Manager:** Import`.conf` profiles, generate mobile QR codes, toggle tunnels, and monitor peer handshakes and transfer stats.
- **Host Kill Switch:** Blocks non-tunnel outbound traffic via firewall rules if the WireGuard tunnel drops.
- **Compact Draggable VPN/Tor Pill:** Floating pill capped at`240px` with a`⋮⋮` drag grip (saved in`localStorage` ) so it never blocks toolbar controls.
- **Mirage Decoy Listener:** Arms local decoy ports to catch unauthorized LAN scans and fingerprint probing hosts.

- **Cortex STDP Anomaly Detector:** Spiking-neural-style temporal anomaly scoring over packet cadence, inter-arrival timing, and flow entropy.
- **Local LLM SOC Triage:** Sends high-anomaly flow summaries and STDP spikes to local`llama-server` (`:8080` ) or Ollama (`:11434` ) for automated threat verdicts and XDP actions.
- **PhishLens:** Evaluates suspicious URLs and message text for credential-harvesting patterns via heuristics and local LLM triage.
- **VocalPrism (Voice-Clone Detector):** Analyzes mic clips or uploaded audio via GPU FFT spectral analysis to flag synthetic/cloned voice harmonics.
- **AgentGate Process Firewall:** Lists local AI/agent processes with 1-click suspend (`SIGSTOP` ) or resume (`SIGCONT` ).
- **LAN ACR Mirage & UDP DNS Sinkhole:** Scans for Smart TV/IoT Automatic Content Recognition beacons and runs a local UDP DNS sinkhole to block trackers LAN-wide.

Docked beside Tab 10 in the tab bar, **AppForge** materializes single-purpose micro-apps in RAM and wipes them back to 0 bytes on eject:

- **Predictive Intent Bar & Instant Seed Cartridges (`< 50ms`):** Auto-detects intent or pasted emails/phones/JSON to launch**Ephemeral Email** (`curl smtps://` + MIME attachments or`mailto:` ),**Dialer & SMS** (`tel:` /`sms:` + optional`adb` ),**LAN File Drop** (16 MB RAM-only),**LAN Voice Call** (WebRTC P2P`iceServers: []` , zero cloud), and**JSON Workbench** .
- **Automated `LlmSupervisor`:** Probes` llama-server` (`:8080` ), falls back to Ollama (`:11434` ), or auto-discovers`llama-server` + a local`.gguf` (`>= 50 MB` ) and streams responses via SSE (`stream: true` ,`enable_thinking: false` , 300s ceiling, zero-idle socket pooling, 1-shot auto-retry) to synthesize compact offline HTML5/Canvas/JS micro-apps inside a sandboxed`<iframe>` with an explicit`postMessage` bridge whitelist.
- **Pin / Export / Eject:** Pin cartridges to`~/.config/caprun/floppy/` , export standalone`.html` , or eject to wipe RAM.

Docked beside `11. AppForge`, **SiliconSuite** bundles four zero-cloud, native-Rust utilities:

- **CleanRoom (Metadata & PII Scrubber + Interactive Redactor):** Strips hidden JPEG (`APP1` –`APP15` /`COM` ), PNG (`tEXt` /`iTXt` /`eXIf` /`tIME` ), and PDF (`/Author` ,`/Producer` , XMP) metadata in RAM with before/after SHA-256 hashes, scans text/files for emails, SSNs, phones, and Luhn credit cards, and includes a mouse/touch`<canvas>` redactor to permanently black-out or mosaic-pixelate faces and text before downloading.
- **NetTruth (ISP Bufferbloat, Throttling & DNS Auditor):** Grades unloaded vs. loaded TCP latency (`A+` –`F` ), measures throughput, checks for ISP DNS NXDOMAIN hijacking, and compares bare-ISP vs. WireGuard VPN runs to expose content throttling.
- **PixelSieve (Offline Exact & Near-Duplicate Reclaimer):** Walks local directories at native Rust speed using SHA-256 exact hashing and perceptual image clustering to reclaim disk space with safe move-to-Trash cleanup.
- **VaultAudit (Password Stress-Tester & Local Secret Scanner):** Estimates GPU-rig crack times offline (with optional zero-knowledge 5-char SHA-1 HIBP k-anonymity lookup) and sweeps local folders for exposed AWS keys, GitHub tokens, PEM private keys, and`.env` secrets.

- **Single-Shot LAN Login Gate (`0.0.0.0:8095`):** Cookie-backed` HttpOnly; SameSite=Lax` auth (256-bit token, 12h TTL, 400 ms backoff) protecting all 12 tabs and`/api/*` . Defaults:`admin` /`toma` (override via`CAPRUN_USER` /`CAPRUN_PASS` ).
- **Pre-Click Hover Previews (`#caprunTip`):** Hover any tab, toggle, or action button across all 12 tabs for a brief description before clicking.
- **Embedded PTY Terminal:** Interactive local shell inside OpsDeck.

```
cd ~/caprun
cargo build --release
sudo setcap cap_bpf,cap_net_admin,cap_net_raw,cap_perfmon,cap_sys_resource,cap_net_bind_service=eip ./target/release/caprun
touch /tmp/sslkeys.log
SSLKEYLOGFILE=/tmp/sslkeys.log nohup ./target/release/caprun opsdeck --iface wlo1 > /tmp/caprun_opsdeck.log 2>&1 &
```

- **Local:**`http://localhost:8095` |** LAN / Phone:**`http://<YOUR_LAN_IP>:8095`
- **Env Overrides:**`CAPRUN_USER` ,`CAPRUN_PASS` ,`CAPRUN_MODEL` ,`CAPRUN_LLAMA_BIN` ,`SSLKEYLOGFILE`

| Subsystem | Endpoints | 
|---|---|
| **Auth** | `GET /login` ,`POST /api/auth/login` ,`POST /api/auth/logout` | 
| **AppForge (Core)** | `GET /api/forge/status` ,`POST /api/forge/materialize` ,`POST /api/forge/llm/ensure` ,`POST /api/forge/pin` ,`POST /api/forge/load` ,`POST /api/forge/delete` | 
| **AppForge (Bridges)** | `POST /api/forge/smtp_config` ,`POST /api/forge/email` ,`POST /api/forge/adb` ,`POST /api/forge/drop/*` ,`POST /api/forge/rtc/signal` ,`POST /api/forge/rtc/poll` | 
| **Telemetry & Intel** | `GET /api/tls/status` ,`GET /api/prism/status` ,`POST /api/intel/flow` | 
| **VPN & Mirage** | `GET /api/vpn/status` ,`GET /api/mirage/status` | 
| **Onion & Radar** | `GET /api/onion/status` ,`GET /api/onion/service/status` ,`GET /api/onion/radar` | 
| **Sentinel Shield** | `GET /api/sentinel/agents` ,`POST /api/sentinel/acr` ,`GET /api/sentinel/dns/status` ,`POST /api/sentinel/dns/clear` | 
| **SiliconSuite (Tab 12)** | `POST /api/suite/cleanroom/scrub` ,`POST /api/suite/cleanroom/pii` ,`POST /api/suite/nettruth/run` ,`GET /api/suite/nettruth/history` ,`POST /api/suite/pixelsieve/scan` ,`POST /api/suite/pixelsieve/trash` ,`POST /api/suite/vault/password` ,`POST /api/suite/vault/secrets` | 

Generic zero-install WebAssembly Linux pages (`unkernel` demos and similar browser-VM projects popping up across the web) are isolated toys: they rely on external mirrors, route traffic blindly through public Wisp relays, lack host visibility, and sit disconnected from any real security stack.

**`caprun` rethinks the entire model.** Inside the same single-binary Rust OpsDeck (`~40 MB`), **SandboxOS** turns a sub-second (`~882 ms`) WebAssembly Linux 7.x desktop into a **host-accelerated, Tor-capable, AI-assisted detonation OS** wired directly into `caprun`'s eBPF/XDP, Spiderweb, Onion Router, and local Vulkan AI stack.

| Capability | Generic Wasm Linux / Vanilla `unkernel` | `caprun` SandboxOS + Hybrid Browser | 
|---|---|---|
| **Network Transport** | Blind public Wisp relay or fully offline | **Native Rust Wisp v1 Turbo Proxy (`/wisp/`)** with 64 KB TCP buffers, 256-packet flow window, and zero external daemons | 
| **Anonymity & Tor** | None (relies on host IP or external VPN) | **Rethought Tor Relay Integration (`Wisp: TOR`)** : dials every guest TCP stream through` socks5h://127.0.0.1:9150` (`:9050` fallback) with remote DNS resolution and hard UDP blocking (`TOR-BLOCK` ) — instant browser Whonix without VirtualBox | 
| **Live Telemetry & Kill Switch** | Zero visibility into guest sockets | **Spiderweb Telemetry Tap** : live stream inspector with mid-session switching between**LIVE** ,**TOR** ,**SINKHOLE** (logs & drops every connection without touching the host network), and**AIR-GAP** | 
| **Host Silicon & Local AI** | Trapped in Wasm RAM/CPU limits | **Silicon Bridge (`caprun.local` / `10.255.255.1`)** : routes`:8080` straight to host Vulkan`llama-server` and`:80` /`:8095` to`caprun` APIs — even while external traffic is sinkholed or Tor-routed | 
| **Malware / Script Forensics** | Manual log hunting | **1-Click AI Forensic Verdict** : feeds captured Wisp socket flows straight to local`llama-server` (`:8080` ) for an offline risk, C2, and exfil report, then nukes the Wasm guest in`<1s` | 
| **Web Recon & `.onion` Browsing** | Spawns a local Chrome/Firefox binary (exposes host fingerprint) | **Docked Hybrid Zero-JS Browser (`src/browser.rs`)** : pure Rust viewer over Tor`:9150` inside OpsDeck that strips`<script>` , trackers, WebRTC, cookies, and UTM params, with**AI Page Triage** and**1-Click Escalate → SandboxOS** under`Wisp: TOR` for heavy-JS targets | 
| **Performance & Scaling** | Fixed low defaults, software rendering | Unlocks **4–8 vCPUs / 2 GB RAM** , native`COOP` /`COEP` + HTTP`Range` streaming, and WebGPU/Vulkan host passthrough (`vk-host` ) | 

- **`src/sandbox.rs` — SandboxOS Engine**  - `GET /sandbox/` ,`GET /sandbox/*` ,`GET /assets/*` — Serves the static Wasm Linux bundle with`COOP: same-origin` ,`COEP: require-corp` ,`Accept-Ranges: bytes` , and zero-fork`CAPRUN // SANDBOXOS` HUD injection.
  - `GET /wisp/` — Native Rust Wisp v1 WebSocket-to-TCP/UDP multiplexer (`LIVE` ,`TOR` ,`SINKHOLE` ,`AIR-GAP` , plus`caprun.local` /`10.255.255.1` Silicon Bridge).
  - `GET /api/sandbox/status` ,`GET /api/sandbox/telemetry` ,`POST /api/sandbox/mode` ,`POST /api/sandbox/telemetry/clear` ,`POST /api/sandbox/analyze` — Live Spiderweb Tap controls and offline Vulkan LLM forensic verdicts.
- **`src/browser.rs` — Hybrid Hardened Browser**  - `GET /api/browser/view?route=tor&url=...` — Zero-JS Rust transport over`socks5h://127.0.0.1:9150` with HTML/CSS URL rewriting, inline event stripping, tracker domain blocking, and strict CSP (`script-src 'none'` ).
  - `GET /api/browser/meta` ,`POST /api/browser/triage` — Live stripped-script/tracker counters and offline AI Page Triage via`llama-server` (`:8080` ), docked directly into OpsDeck's center pane behind**Launch Hardened Browser** .

Beyond its 13-tab OpsDeck, eBPF/XDP packet engine, Tab 13 **SandboxOS**, and docked **Hybrid Zero-JS Browser**, `caprun` compiles a full 6-pillar enterprise defense stack directly into the same portable Rust binary—zero external databases, brokers, or VM hypervisors required.

| Pillar | Module | Enterprise Capability | Key Endpoints / CLI | 
|---|---|---|---|
| **1. Zero-Trust HTTPS + Local CA** | `src/tls_ca.rs` | Dual-stack native `rustls` HTTPS (`:8443` ) alongside HTTP (`:8095` ) with an auto-generated ECDSA P-256 Root CA and dynamic LAN-IP SAN leaf certs—unlocking`wss://` Wisp and zero-flag`SharedArrayBuffer` on LAN devices | `GET /api/https/status` ,`GET /api/https/ca.crt` | 
| **2. Persistent Vault & PCAP Index** | `src/store.rs` | Bundled SQLite WAL telemetry vault ( `~/.local/share/caprun/vault/telemetry.db` ) with**SHA-256 hash-chained** chain-of-custody records, rolling 500 MB PCAP archive indexing, and 1-click signed forensic case bundles | `GET /api/vault/stats` ,`/search` ,`/verify` ,`/pcaps` ,`/export` ,`POST /api/vault/record` | 
| **3. JA4 + Beaconing + YARA Engine** | `src/detect.rs` | Spec-compliant FoxIO **JA4 TLS ClientHello** fingerprinting on encrypted streams, periodic**C2 Beaconing** (`CV%` jitter) detection, and a pure-Rust**YARA-syntax** scanner (10 built-in rules + live`.yar` hot-reload) wired into Wisp and the Hybrid Browser | `GET /api/detect/summary` ,`POST /api/detect/scan` ,`/rules` ,`/clear` | 
| **4. RBAC & Scoped API Tokens** | `src/rbac.rs` | Three-tier role enforcement ( `ADMIN` ,`ANALYST` ,`AUDITOR` ), SHA-256 hashed scoped tokens, non-disruptive`AUDIT` vs.`ENFORCE` modes,`chmod 600` bootstrap admin key, and Vault-attributed access decisions | `GET /api/rbac/whoami` ,`/status` ,`POST /api/rbac/mode` ,`/tokens` ,`/revoke` | 
| **5. Autonomous SOAR & STIX 2.1** | `src/soar.rs` | Declarative playbooks ( `SINKHOLE_SANDBOX` ,`AIRGAP_SANDBOX` ,`BLOCK_IOC` ,`WEBHOOK` ,`LOG_INCIDENT` ) plus 1-click**Abuse.ch Feodo** ,**URLhaus** , and**STIX 2.1 JSON** threat intel sync enforced live across Wisp, Hybrid Browser, and Fleet | `GET /api/soar/summary` ,`POST /api/soar/sync` ,`/ioc/add` ,`/playbook/toggle` ,`/playbook/add` ,`/webhook` ,`/test` | 
| **6. Distributed Fleet Mode** | `src/fleet.rs` | Same binary runs headless as `caprun agent` on remote Linux hosts, streaming`/proc` vitals and established TCP flows over HTTPS/HTTP with RBAC auth, Master SOAR IOC enforcement, and remote`PING` /`SNAPSHOT` /`SCAN_FILE` (Master YARA) task dispatch | `caprun agent --master <URL> [--token <TOK>] [--insecure]` ,`GET /api/fleet/summary` ,`POST /api/fleet/heartbeat` ,`/ingest` ,`/task` ,`/result` ,`/remove` | 

```
# Deploy the exact same binary on any remote Linux host or mobile Linux environment:
./caprun agent --master https://<OPSDECK_LAN_IP>:8443 --insecure   --token "$(cat ~/.local/share/caprun/rbac/bootstrap-admin.token)"   --name $(hostname)
```


