@@ -301,6 +301,53 @@ $ hackingbuddygpt-log-analyze logs/*.jsonl
301301$ hackingbuddygpt-log-analyze logs/* .jsonl --latex --model gpt-4o --min-duration 30
302302` ` `
303303
304+ # # Benchmarking against a fleet of Docker targets
305+
306+ For regression testing and quick experiments we ship a small benchmark launcher,
307+ ` benchmark_privesc.py` , in the repository root. It attacks a fleet of ** locally running Docker
308+ containers** whose image names start with ` privesc_` (for example the vulnerable boxes from our
309+ [Linux Privilege-Escalation Benchmark](https://github.com/ipa-lab/benchmark-privesc-linux)),
310+ runs a privilege-escalation use-case once against each, and produces a report.
311+
312+ For every matching, running container it:
313+
314+ 1. discovers the container and its published SSH port automatically from ` docker ps` ,
315+ 2. runs the use-case via ` wintermute` with a selectable LLM and a per-run turn budget (` --rounds` ),
316+ 3. scores the run by reading back its OpenTelemetry/GenAI JSONL trace (a box counts as rooted when
317+ the trace' s final state is `got root`), and
318+ 4. writes a Markdown `report.md` plus the per-run JSONL traces and console logs under
319+ `benchmark_results/<timestamp>/`, alongside a console summary of rooted/failed systems and token
320+ cost.
321+
322+ You can drive it with a **local [Ollama](https://ollama.com/) model** (the default, no API key
323+ needed) or with **[OpenRouter](https://openrouter.ai/)**. Run it from inside the project
324+ virtualenv so `hackingBuddyGPT` is importable:
325+
326+ ```bash
327+ # make sure the target containers are running first, e.g. the privesc benchmark images
328+ $ docker ps --format ' {{.Names}}\t {{.Image}}' # images should start with ' privesc_'
329+
330+ # option A: local Ollama model (default provider, no API key required)
331+ $ uv run benchmark_privesc.py --provider ollama --model ollama_chat/llama3 --rounds 20
332+
333+ # option B: OpenRouter (pass --api-key or set $OPENROUTER_API_KEY)
334+ $ uv run benchmark_privesc.py --provider openrouter \
335+ --model openrouter/anthropic/claude-3.5-sonnet --api-key sk-or-... --rounds 20
336+ ```
337+
338+ Useful options (see `benchmark_privesc.py --help` for the full list):
339+
340+ - `--use-case` — which privesc use-case to launch (default `MinimalPrivEscLinux`; the
341+ function-calling prototype is `MinimalToolCallPrivEscLinux`).
342+ - `--filter SUBSTR` — only run containers whose name/image contains `SUBSTR`.
343+ - `--trials N` — run each container `N` times (useful for measuring variance).
344+ - `--rounds N` — per-run turn budget (mapped automatically to `--max_turns` or
345+ `--limits.max_rounds` depending on the use-case).
346+ - `--max-cost`, `--run-timeout` — optional per-run cost cap and wall-clock timeout.
347+ - `--ollama-host`, `--or-provider` — Ollama base URL / OpenRouter provider routing.
348+ - `--username`, `--password`, `--ssh-host` — SSH credentials/host for the target containers
349+ (default `lowpriv` / `trustno1` on `127.0.0.1`).
350+
304351## Use Cases
305352
306353GitHub Codespaces:
0 commit comments