Files
NeuroSploit/bench/README.md
T

103 lines
4.1 KiB
Markdown

# Reproducible local benchmark (NimbusCart)
A local, deterministic target for measuring **coverage, proof, time and cost** of a
NeuroSploit run. The target is the BurpAT/NimbusCart lab: 65 seeded WEB, API and LLM
scenarios, each with its own `BURPAT{scenario_id_hex}` flag.
> **Authorized, isolated lab only.** The target contains working RCE, command injection,
> SSRF and path traversal. Run it on localhost/throwaway infrastructure, never on a shared
> or production network. The answer key (`SOLUTIONS.md`) stays outside the harness input.
## Quick start
```bash
# one-time: install the lab (it lives outside this repo)
cd /opt/BenchMarkBurpAT && npm install
# run a cheap baseline (<=6 agents, 1 voter, eco budget)
cd /opt/neurosploit-rs
python3 bench/run.py --preset quick
# a wider run
python3 bench/run.py --preset standard
python3 bench/run.py --preset deep --timeout 7200
```
The runner starts its own lab on `127.0.0.1:3001`, resets it, runs
`target/release/neurosploit`, stops the lab, copies the useful artifacts and scores the run.
Use `--no-start --target http://127.0.0.1:3000` to score an existing lab instead.
```bash
# score any finished run
python3 bench/score.py runs/ns-...
python3 bench/score.py runs/ns-... --log /tmp/run.log --json
# scorer tests
python3 -m unittest bench/test_score.py
```
## What it measures
`bench/score.py` keeps two signals separate:
- **strict** — the exact `BURPAT{scenario_id_...}` flag was captured anywhere in the run
(`findings.json`, reports, evidence, PoCs, run log). This is proof, not a claim.
- **reported** — a finding's class + endpoint (plus a disambiguating hint) matches a seeded
scenario. This catches client-side classes (XSS, CSRF, clickjacking) where a flag may be
produced only by a browser beacon.
- **union** — either signal. The headline coverage number.
- **extra findings** — reported but not matched to a seeded scenario. They are listed, not
counted as false positives: a real chain can go beyond the seeded set.
The runner also records duration, input/output tokens and estimated cost (when the model
reports them), findings, validated findings, and agents that ran.
## Presets
| preset | shape |
|---|---|
| `quick` | `--quick` (≤6 agents, 1 voter, 1 chain round, light recon, eco) |
| `standard` | 12 agents, 1 voter, balanced budget, recon 3, chain 1 |
| `deep` | all agents, 1 voter, unlimited budget, recon 4, chain 2 |
All runs use `--environment lab`, `--typesafe off` and an explicit model
(`deepseek:deepseek-flash` by default). Override with `--model` (repeatable).
The baseline engine is `--engine phased`; use `--engine auto` for the product default
(reactive) and `--engine reactive` to force it. The reactive worker tool loop is off
unless `--worker-tools` is passed, so an LLM-only baseline is not dominated by recon tools.
```bash
python3 bench/run.py --preset standard \
--model deepseek:deepseek-flash \
--repeat 3 --timeout 3000
```
## Output
Results are written under `benchmarks/runs/` (git-ignored) by default:
```
benchmarks/runs/nimbuscart-<timestamp>/
summary.md aggregate compact score
run-1/
command.json exact argv, model, preset, duration, exit
run.log full harness output
artifacts/ findings, reports, recon, status, audit, ...
score.json machine-readable score
summary.md per-run score + hit/missed lists
```
`--out DIR` changes the destination. The `artifacts/` copy can contain target secrets and
found flags: treat it like any other engagement output, do not commit it.
## Notes
- The lab is external; set `NIMBUSCART_LAB` or `--lab`.
- `--no-start` reuses a running target; it cannot reset in-memory state between repeats.
- `--recheck` adds `--revalidate-poc`; `--token-limit N` caps run spend.
- `--engine phased|auto|reactive` selects the pipeline; `--worker-tools` enables the
reactive tool loop.
- A single run is one sample. Use `--repeat` for a mean and report variance, not a leaderboard.
- The present `benchmarks/typesafe-2026-09-20/` run is a historical 13-scenario sample, not
this 65-scenario benchmark; `bench/score.py` can still read it.