feat: proof screenshots in reports (finding-correlated) + source-able env.sh (#37)

* feat: embed proof screenshots in reports, correlated to findings

Define a convention that ties each proof image to its vulnerability and
renders it in every report format.

- Finding gains `screenshots: Vec<String>` (paths relative to the run
  workdir, e.g. evidence/<finding-id>-1.png).
- Exploit prompt injects an EVIDENCE SCREENSHOTS doctrine: agents save
  proof PNGs into the run's absolute evidence/ dir named by a vuln slug,
  and list them in the finding JSON `screenshots` array.
- collect_evidence() resolves whatever the agent captured (absolute,
  workdir-relative, evidence/, /tmp basename), copies it to a stable
  evidence/<finding-id>-N.png, and rewrites the field; unresolved refs
  are dropped so a report never embeds a missing image.
- Typst (image()), HTML (<img>) and Markdown (![]) render each finding's
  screenshots beside its evidence.

Tests: slugify + collect_evidence resolution/rename; verified a real PDF
compiles with an embedded image.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BGLy4j5qsqqid6CoovowC

* feat: source-able env.sh to activate neurosploit in the current shell

Add env.sh: `source` it to export NEUROSPLOIT (binary path),
NEUROSPLOIT_BASE (agents base) and prepend the binary dir to PATH —
no reinstall or new terminal needed. Auto-detects the install/repo dir,
honors NEUROSPLOIT_DIR, idempotent. setup.sh now writes a ready env.sh
into the install dir and points users at `source <dir>/env.sh`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BGLy4j5qsqqid6CoovowC

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Joas A Santos
2026-07-31 20:32:15 -03:00
committed by GitHub
co-authored by Claude Opus 4.8
parent b55b5fa32e
commit 4eed1ce652
6 changed files with 286 additions and 6 deletions
+12 -2
View File
@@ -120,6 +120,15 @@ fi
mkdir -p "$PREFIX"
ln -sf "$DIR/neurosploit" "$PREFIX/neurosploit"
ok "Linked → $PREFIX/neurosploit"
# ---- write a source-able env script (activate in the CURRENT shell) ----
cat > "$DIR/env.sh" <<EOF
# NeuroSploit env — \`source\` this to use neurosploit in the current shell.
export NEUROSPLOIT_BASE="$DIR"
export NEUROSPLOIT="$DIR/neurosploit"
case ":\$PATH:" in *":$PREFIX:"*) : ;; *) export PATH="$PREFIX:\$PATH" ;; esac
EOF
ok "Wrote env script → $DIR/env.sh (source it to activate now)"
ok "Version: $(NEUROSPLOIT_BASE="$DIR" "$DIR/neurosploit" --version 2>/dev/null || echo neurosploit)"
# ---- persist env (PATH + NEUROSPLOIT_BASE) so it runs from any folder ----
@@ -152,8 +161,9 @@ for t in curl nmap rustscan ffuf node npx typst; do
done
echo
ok "Installed. Open a NEW terminal — or run now with:"
echo " export NEUROSPLOIT_BASE=\"$DIR\"; export PATH=\"$PREFIX:\$PATH\""
ok "Installed. Open a NEW terminal — or activate now with:"
echo " source \"$DIR/env.sh\""
echo " (equivalently: export NEUROSPLOIT_BASE=\"$DIR\"; export PATH=\"$PREFIX:\$PATH\")"
echo " then, from ANY folder:"
echo " neurosploit # interactive session"
echo " neurosploit run http://testphp.vulnweb.com/ --subscription --model anthropic:claude-opus-4-8 -v"