Files
NeuroSploit/web
18b97faeff Grounded chat with scoped tools, and an address for every view (#136)
* feat(chat): tools through the toolbox, and citations the server checks

The chat read the engagement and answered from it. Three things were wrong
with that, and the first is mine.

Records went into the prompt unguarded. A finding's evidence is a copy of what
a TARGET sent us, so pasting it raw hands the target a turn at writing our
instructions. ARTEX fences its mention snapshots; we did not. Every record is
now fenced and prefaced as data, and every field is bounded, so neither a long
response body nor a crafted one steers the answer.

Nothing checked the answer. This harness has already produced a Critical whose
proof was `{"token":"eyJ..."}` — a placeholder, an attack described rather than
run. The model now cites [run:ID] and [finding:ID#N], and the server resolves
each citation against the files on disk before the answer is final. An
unresolved citation is reported with a reason, because two failures look alike
and are not: a record that exists but was not attached means the model is
reciting, and one that exists nowhere means it is inventing. Evidence carrying
placeholder tokens is flagged to the model as described, not demonstrated.

The chat could not act. It now runs real tools through agentic_tools, which
means through toolbox::run — so the scope built from the run's own target, the
operator's constraints, the sandbox and toolbox-audit.jsonl all apply. The
chat gets no path to the network an agent does not have. Tools need an
attached run because the run's target is the only thing that authorises a
packet; with none, it reads only.

Two defects found by running it against a live target rather than reasoning
about it: the catalog was missing, so the model invented tool ids (`http_get`,
`exec`) and burned the budget being told they do not exist — the same failure
visible in today's reactive run; and a loop that stopped early returned its raw
transcript as the answer. It now synthesises from what the tools actually
returned, and says plainly when they established nothing.

Verified against runs/ns-1787519539-testaspnet_vulnweb_com: 28 citations, all
resolved, validated and unvalidated findings correctly separated. A forced
answer citing one real-but-unattached run and one fictional run classified both
correctly. Against evidelo the loop held scope (evidelo.com.br), chose real
catalog tools, and — with the host missing the binaries — reported that it
could not fetch robots.txt rather than reciting paths it had in context.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(console): give every view an address

The console was one page that answered to one URL. Clicking Chat and clicking
Findings left you at `/`, so you could not bookmark a view, send a colleague
the findings list, reload without being thrown back to home, or use the back
button for anything but leaving the app.

Each view now has a real path (/dashboard, /chat, /findings, /assets/…), kept
in step with history: a click pushes, boot and openRun replace, and popstate
switches without writing back so the back button is not fought. The server
serves index.html for extensionless paths, and the app reads the path on boot
and opens that view. A request for a missing file still 404s — an extension
means an asset.

Separate pages would have given the same addresses and cost a refactor of an
11k-line app.js, plus a reconnect of the four SSE streams on every navigation,
which is the one thing this console must not drop. Splitting is worth doing
later as ES modules behind one page, not as separate pages.

Two things that would have broken on a nested route: the favicon was the only
relative asset path, so /assets/networks asked for /assets/logo.svg; and the
auth gate only covered '/', so the new fallback would have served the console
shell to an unauthenticated request for /chat. Both fixed here — the gate now
covers anything that resolves to the shell.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Joas A Santos <34966120+CyberSecurityUP@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-12-05 01:10:06 -03:00
..

NeuroSploit v4.2.0 — web console

A browser UI for the neurosploit CLI harness: a 5-step engagement wizard (Asset → Scope & Auth → Leads → Model & Run → Review), a live structured findings view with a generative attack-path graph, run history, an Auth & Keys menu, and a real terminal — all driven by spawning the actual CLI binary, never a reimplementation of harness logic.

  • Asset — pick black/white/grey-box, host/infra, or AI/LLM, set the target or repo.
  • Scope & Auth — objective, focus, out-of-scope, and a link into the Auth & Keys menu.
  • Leads — the categorized agent picker (435 agents auto-classified) + custom leads.
  • Model & Run — pick a provider/model from the live catalog, API-key vs. subscription auth mode, votes/chain-depth/recon intensity.
  • Review — confirm the plan, then Start Exploitation spawns the real CLI.
  • Auth & Keys (one menu, 🔑 in the sidebar) — target auth header + named roles for IDOR/BOLA/BFLA testing, per-provider API keys (kept in server memory only, never on disk), and an explicit creds.yaml path override.
  • Attack graph — the run's graph memory (web + internal network): host → service → finding → credential → impact, every edge marked confirmed / needs validation / hypothesis, findings ordered by kill-chain stage. Refreshed live at each graph checkpoint; click a finding to open it. Chains and Dependencies list the same paths as text and as the step-by-step todolist.
  • Wire evidence in the finding — the finding modal shows the real request/response pairs the harness measured (baseline vs. attack, the identity pair, matrix probes, the oracle), each tagged with its wire provenance, plus the finding's wire-check summary and any recorded flow on the same endpoint. The proof as bytes, not as the agent's prose.
  • Per-finding re-test with history — ⟳ Re-test re-runs one finding's recorded proof through the scope-guarded replay engine and keeps a dated history (reproduced / changed / gone / unverifiable), so a finding drifting to "gone" over time is visible. Nothing is written back to the findings.
  • Transcript viewer — the Traces tab renders a chosen agent's transcript split into navigable, collapsible blocks at each tool-call / HTTP-request boundary; search still spans every agent.
  • Terminal dock (xterm.js) — ❭_ in the sidebar, the topbar button, or Ctrl+\`` opens a docked terminal running a real neurosploitREPL session. Its stdout is streamed **unstripped**, so the harness's own colour and box-drawn panels render as they do in a local shell. Line editing (echo, ←/→, history,Tabslash-command completion,Ctrl+C/L/U/A/E`) is local because the child is spawned over a pipe, not a PTY, and therefore never echoes. The target picker in its header switches between a standalone session and the running engagement, so mid-run instructions go to the same process that is doing the testing.
  • Real REPL underneath run/whitebox/greybox — the wizard scripts an actual interactive neurosploit session instead of a one-shot CLI call, so it keeps reading stdin while the engagement streams. The Activity log tab grows a ❭ prompt box to send /status, /stop, /continue, or a plain-language instruction mid-run. host/aitest/skills stay one-shot (their onboarding scope picker can't be scripted over piped stdin).
cd neurosploit-rs && cargo build --release   # build the CLI once
node web/server.js                            # → http://localhost:4173

Zero npm dependencies (Node ≥18, built-ins only: http, child_process, events, fs).

API reference: API.md.

Layout

web/
├── server.js         backend: static server + agents_md/runs reader + CLI process manager
├── public/
│   ├── index.html     SPA shell
│   ├── style.css       lead-board / live-run / terminal-dock styling
│   ├── app.js          client logic (fetch + EventSource + terminal, no framework)
│   └── vendor/         xterm.js + fit addon (vendored; nothing is fetched at runtime)
├── API.md
└── package.json