Commit Graph
478 Commits
Author SHA1 Message Date
Joas A SantosandClaude Opus 5 68c1f5d879 feat(skills): add routing frontmatter so the exploration loop can run
No shipped agent had frontmatter. Not five, as a `grep '^---'` suggests —
that matches horizontal rules in the body. Zero files begin with it.

That made the exploration loop dead code. `route` scores a skill as
10*(trigger hits) + 0.5*priority + 25 per chain edge from a finding, and
its no-metadata fallback is gated on `round == 0`. The loop starts at
`round = 1`. So every skill scored 0.0, was dropped by the `score > 0.0`
filter, `next_round` returned empty, and the loop hit `break` on its first
iteration — every run, in all six modes.

Add frontmatter to 91 core skills: 207 chain edges across injection, file
access, SSRF and cloud, auth and access control, client-side,
deserialisation, CMS, infra and LLM. Priority is >= 10 throughout, the floor
at which a single trigger hit clears the score >= 15 gate that `next_round`
applies past the first round.

Chains encode the escalation paths the harness is meant to walk on its own:
ssrf to cloud metadata to IAM privesc, sqli to postgres RCE, file_upload to
command_injection, sourcemap_exposure to js analysis to api_key_exposure,
jwt_manipulation to alg confusion to privilege_escalation.

Four tests, three of them against the shipped catalogue on disk: that it
routes at round 1, that a confirmed ssrf finding pulls cloud_metadata_exposure
in by chain, that no chain edge names a skill that does not exist, and a
regression pair pinning the round-1 behaviour that was broken.

439 skills still carry no frontmatter and reach only the round-0 sweep.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:17:08 -03:00
Joas A Santos f8856e6fe4 Merge pull request #123 from JoasASantos/feat/kali-native-console
feat(docker): run the console on the Kali toolbox image
2026-12-04 11:10:01 -03:00
Joas A SantosandClaude Opus 5 eaff7a7cf5 feat(docker): run the console on the Kali toolbox image, add .dockerignore
The console ran on debian-slim and reached tools by spawning a sibling Kali
container per command, through the mounted docker socket. Build the console
FROM the toolbox image instead: nmap, sqlmap, ffuf, nuclei, impacket, Ghidra
and the rest are on PATH in the same container the harness runs in. A run
set to sandbox "host" now executes tools in place; picking an image in the
UI still spawns an isolated sibling, so isolation stays available.

This makes build order load-bearing — the console image cannot resolve its
base until the toolbox image exists. install.sh builds kali-base first, then
neurosploit. Renamed the service from kali-worker to kali-base to say what it
is now: a base layer, not a worker pool.

Add .dockerignore. The build context was 19GB, 18GB of it neurosploit-rs/
target/, which the builder stage recompiles anyway; runs/ carried engagement
data into the context as well. agents_md/ is explicitly preserved.

Dropped NS_WORKER_IMAGE and NS_SANDBOX from the compose environment: neither
is read anywhere in the harness or the web server. The sandbox image comes
from the per-run --sandbox flag.

Also fixes install.sh printing a literal ${NS_PORT:-8787} in its closing
banner, and makes it wait for the console to answer before declaring success.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:09:31 -03:00
Joas A Santos 7ec16de34c Merge pull request #122 from JoasASantos/fix/dashboard-severity-fair
fix(web): severity counts, FAIR dedup/damping, PR modal markup
2026-12-04 10:48:46 -03:00
Joas A SantosandClaude Opus 5 7c255ada3e fix(web): severity counts from /api/issues, FAIR dedup and damping, modal markup
Severity cards read 0 for critical/high/medium/low: /api/db/stats is empty
without PostgreSQL and per-run `severities` is unpopulated. Count from
/api/issues, which carries the per-finding severity.

FAIR exposure read $400M most likely / $1.6B max. Two modelling errors:
the same finding reported by several agents was counted once per report,
and thirty criticals on one host were summed as thirty independent
breaches. Collapse duplicates on (title, target), then damp additional
findings per target harmonically — an attacker compromises a host once.
Lands at $89.2M / $362M on the same data.

PR review modal used classes that are not display:block, so labels and
inputs ran inline. Use the field-group / field-label / field-help pattern
the other modals use.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 10:48:22 -03:00
Joas A Santos bf4f3f74e2 Merge pull request #121 from JoasASantos/fix/frontend-polish
fix(web): frontend polish — stats, toolbox, PR review
2026-12-04 10:37:00 -03:00
Joas A SantosandClaude Opus 4.6 76ce3101cc fix(web): dashboard stats in pentests view, toolbox JSON parse, PR review modal
- Move dashboardStats into pentests view (was global, polluting all pages)
- Make stats cards reflect actual run data from file storage
- Fix toolbox JSON parsing: separate stdout/stderr in runCli, handle
  array JSON in toolsCall (was only matching object patterns)
- Add New PR Review modal with repo/PR input form
- Target table click now switches to pentests view
- Dashboard cards: severity-colored layout with CSS
- Strip redundant Storage card from stats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 10:36:29 -03:00
Joas A Santos 00b2458e14 Merge pull request #120 from JoasASantos/feat/v5-phase3-polish
feat(v5): Kali worker + user registration + login UI
2026-12-04 10:22:56 -03:00
Joas A SantosandClaude Opus 4.6 796447ab89 feat(v5): enhanced Kali worker, user registration, login UI overhaul
- Dockerfile.kali: add Ghidra 11.2.1 for headless RE analysis, evil-winrm,
  awscli, kubectl, mitmproxy, gdb/ltrace/strace, aircrack-ng, JDK 17
- server.js: add /api/auth/register endpoint (first user = admin),
  fix auth status response keys for login page consistency
- login.html: redesigned login with registration flow, improved
  glassmorphism styling, better error handling and animations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 10:22:34 -03:00
Joas A SantosandClaude Opus 4.6 eabfffe4c1 fix(web): pg pool dedup, DATABASE_URL support, login token key consistency
- Remove duplicate pgPool/pgQuery/pgSaveRun/pgCompleteRun/pgGetRuns/pgGetFindings
  declarations in server.js (caused SyntaxError at startup)
- Add DATABASE_URL connection string support alongside NS_PG_*/POSTGRES_* env vars
- Add connection test on startup with graceful fallback to file storage
- Fix login.html localStorage key mismatch: getItem('ns-token') → 'ns_token'
  to match the key used by setItem and app.js

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 10:15:57 -03:00
Joas A Santos 8ba2a710d2 Merge pull request #119 from JoasASantos/feat/v5-phase2-planner-re-pool
feat: v5 phase 2 — planner/worker, LLM failover, RE integration, traffic recording
2026-12-04 10:13:45 -03:00
Joas A SantosandClaude Opus 4.6 14cefda590 feat(v5): planner/worker architecture, RE integration, LLM failover, traffic recording
Phase 2 of the v5 autonomous refactoring:

- Planner/Worker loop (planner_loop.rs): intent-driven exploration with
  shared graph state, dependency tracking, parallel worker execution,
  budget-aware termination. Opt-in via NEUROSPLOIT_PLANNER=1. Wired
  into all 6 pipeline modes (web, host, whitebox, greybox, container,
  mobile).

- LLM failover pool (llm_pool.rs): per-provider circuit breakers with
  configurable threshold/recovery, rate limiting, noise profiles
  (quiet/balanced/aggressive), provider health tracking.

- Reverse engineering integration (re_integration.rs): Ghidra headless
  decompilation with fallback to objdump/readelf/strings. Binary triage,
  vuln pattern detection, attack surface scoring.

- Traffic recording (traffic_record.rs): full HTTP capture with WAF
  detection, search, HAR export, JSON persistence.

- Finding dedup (finding_dedup.rs): BM25-based similarity scoring.
- Hypothesis tracking (hypothesis.rs): open/closed investigation directions.
- Noise profiles (noise_profile.rs): quiet/balanced/aggressive pacing.
- Scope relaxation: auto_expand_discovered, follow_auth_redirects, expand_asn.
- PostgreSQL wiring with full schema.

Build: 0 errors, 0 warnings, 1150 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 10:13:21 -03:00
Joas A SantosandClaude Opus 4.6 2a3e13aeef feat(harness): v5 phase 2 — planner/worker, LLM failover, RE, traffic recording
Planner/Worker architecture:
- Intent-graph-driven exploration with LLM planner emitting ExplorationIntents
- Async workers claim and execute intents in parallel
- Plan → execute → harvest → replan loop until convergence
- Dependency-aware intent scheduling

LLM failover pool:
- Circuit breaker per provider (threshold + timeout recovery)
- Token bucket rate limiter per provider
- FailoverChain auto-detects providers from env API keys
- Health tracking: latency, error rate, total tokens
- complete_with_failover() wraps pool calls with health recording

Reverse engineering integration:
- Ghidra headless + radare2 binary analysis backends
- BinaryInfo, FunctionInfo, StringInfo, ImportInfo extraction
- VulnIndicator scoring (dangerous functions, format strings, crypto)
- Attack surface scoring algorithm
- format_for_llm() injects analysis into agent prompts
- re_pipeline() async entry point returning Finding vec

Traffic recording:
- Full HTTP request/response recording with HAR 1.2 export
- TrafficEntry with agent attribution, tags, finding linkage
- WAF detection from response patterns
- Global store with search, filter, stats
- JSON persistence + HAR export at run end

Finding dedup:
- BM25-based textual similarity deduplication
- Multi-signal scoring: vuln type, endpoint, parameter, token overlap
- Higher severity/evidence kept on merge

Hypothesis tracking:
- Investigation directions with Open/Confirmed/Disproved lifecycle
- Evidence accumulation (for/against)
- generate_from_recon() creates initial hypotheses
- Persistence across rounds via JSON save/load

Noise profiles:
- Quiet/Balanced/Aggressive scan pacing
- Tool-specific rate-limit flags injected into agent prompts
- nmap, nuclei, httpx, katana, ffuf, dalfox, sqlmap, gobuster, feroxbuster

Scope relaxation:
- auto_expand_discovered, follow_auth_redirects, expand_asn_ranges
- registrable_domain() helper for scope expansion

Build: 0 errors, 0 warnings, 1150 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 10:13:02 -03:00
Joas A Santos 508c36d562 Merge pull request #47 from JoasASantos/dependabot/cargo/neurosploit-rs/quinn-proto-0.11.19
chore(deps): bump quinn-proto from 0.11.14 to 0.11.19 in /neurosploit-rs
2026-12-04 01:38:25 -03:00
Joas A Santos bf9bac4d62 Merge pull request #48 from JoasASantos/dependabot/cargo/neurosploit-rs/rustls-0.23.46
chore(deps): bump rustls from 0.23.40 to 0.23.46 in /neurosploit-rs
2026-12-04 01:38:15 -03:00
Joas A Santos de6f9166b4 Merge pull request #118 from JoasASantos/feat/v5-autonomous-refactor
feat: NeuroSploit v5 — autonomous pentest agent refactor
2026-12-04 01:37:56 -03:00
Joas A SantosandClaude Opus 4.6 f5dcc3f459 feat(infra): Docker + PostgreSQL + Kali worker setup
- docker-compose.yml: PostgreSQL 16, neurosploit app, kali-worker
- Dockerfile: multi-stage Rust build + Node runtime
- Dockerfile.kali: kalilinux/kali-rolling with full pentest toolbox
- install.sh: auto-generate credentials, build images, start services
- db/schema.sql: PostgreSQL schema for runs, findings, auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:37:20 -03:00
Joas A SantosandClaude Opus 4.6 1c7a0d0a9b feat(web): auth system, Morse provider, SSE exploration events
Auth middleware (zero external deps):
- JWT + scrypt authentication in server.js
- Auto-generated default credentials from env vars
- Rate-limited login (10/min), change-password, verify endpoints
- Glass-morphism login page with first-login detection

Morse provider:
- Added to server.js PROVIDERS array and .env.example
- Uncensored open-weight models with native tool calling

Frontend:
- Bearer token injection in api() calls
- 401 auto-redirect to login
- SSE exploration round events

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:37:14 -03:00
Joas A SantosandClaude Opus 4.6 36d6cb216a feat(harness): add USD budget tracking and cost enforcement
Hierarchical budget system inspired by ARTEX:
- BudgetLedger: thread-safe per-agent and total cost tracking
- ModelPricing: per-million-token pricing for all major providers
  (Anthropic, OpenAI, DeepSeek, Gemini, Qwen, Groq + fallback)
- NEUROSPLOIT_BUDGET_USD env var for max spend enforcement
- wrap_up_mode() at 95% (5% reserve for validation/reporting)
- Cost recording wired into all 4 LLM completion paths
- cost.json persistence to workdir
- Human-readable cost report with top-8 agent breakdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:37:07 -03:00
Joas A SantosandClaude Opus 4.6 53c547d4fb feat(harness): add coverage tracking ledger
Track tested endpoints × vulnerability classes to identify attack surface gaps:
- 55+ web vuln classes, 30+ infra, 17 cloud, 20 mobile, 17 binary
- CWE-to-class mapping for 40+ CWE IDs
- Agent name inference when CWE is missing
- Technology-aware filtering (e.g., GraphQL classes only when detected)
- Gap analysis with priority ranking
- Persistence to coverage.json for cross-run accumulation
- Integrated into exploration loop for all modes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:36:59 -03:00
Joas A SantosandClaude Opus 4.6 77aadf5ed1 feat(harness): exploration loop, sourcemap harvest, WAF adaptive bypass
Major pipeline enhancements:

1. Reusable exploration_loop() function wired into ALL modes:
   - run() (web), run_host(), run_greybox(), run_whitebox(),
     run_container(), run_mobile()
   - Skill-driven chained exploitation with FindingIntel extraction
   - Re-recon enrichment: discovered intel feeds back into agent context

2. Deterministic sourcemap harvest:
   - Scans JS bundles for .map files after CAG collect
   - Extracts secrets (AWS keys, API keys, GitHub PATs, passwords)
   - Discovers API endpoints from source code
   - Feeds intel into recon context for all agents

3. WAF adaptive bypass:
   - Vendor-specific bypass strategies based on probe detection
   - Covers Cloudflare, Akamai, AWS WAF, Imperva, ModSecurity,
     F5/BIG-IP, Sucuri, Fastly, Azure Front Door
   - Injected into shared_block for all exploit agents

4. attack_chain() wired into whitebox, container, mobile modes
   (previously only web and host had it)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:36:53 -03:00
Joas A SantosandClaude Opus 4.6 19d33f48bb feat(harness): add skill-based architecture with frontmatter metadata
Transform agent markdown files into skills with structured frontmatter:
- triggers: signal patterns that activate the skill
- chains_from: other skills whose findings trigger this one
- cwes: mapped CWE IDs for coverage tracking
- priority: base priority for skill routing
- max_rounds: execution budget per skill

New skill.rs module:
- SkillCatalog: loads and indexes all skill files
- SkillRouter: scores skills based on recon signals + findings
- FindingIntel: extracts credentials, endpoints, secrets from findings
- ExplorationBudget: configurable round/skill limits via env vars
- next_round(): selects next skills to run based on current findings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:36:42 -03:00
Joas A SantosandClaude Opus 4.6 9a087833a6 fix(harness): resolve 37 compilation warnings and 3 bugs
Bug fixes:
- attack_graph.rs: remove unreachable duplicate CWE match arms (915, 384, 770, 799)
- pipeline.rs: wire technology detection flags into agent negative scoring
- pipeline.rs: add Hermes/DeepSeek V2 format detection to looks_like_tool_call

Cleanup: remove 10 unused imports, prefix 7 unused vars, remove 2 unnecessary
mut qualifiers, mark 5 dead code items, remove 1 unnecessary parenthesis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-12-04 01:36:34 -03:00
CyberSecurityUPandClaude Haiku 5.5 9e50dcbfec feat(harness): recover tool calls written as model markup
Models such as DeepSeek emit DSML, Hermes or JSON action markup instead of
findings JSON, which dropped the agent's work. Parse those dialects, map
shell-style calls onto catalog tools (refusing chaining and redirects), and
run them in scope before asking the model for findings. The agentic loop
accepts the same recovered call as a normal action.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-12-04 00:19:59 -03:00
Joas A Santos 5238f9b03f feat: add reproducible NimbusCart benchmark harness (#116) 2026-12-03 23:22:33 -03:00
Joas A Santos 00c5c87bff feat: add traffic store for browser captures (#115) 2026-12-03 22:48:50 -03:00
Joas A Santos f793e90a08 Merge pull request #114 from JoasASantos/feat/browser-capture
feat: real-browser capture for SPA/Cloudflare (P0 milestone 2)
2026-12-03 22:05:26 -03:00
CyberSecurityUP 16c33e79f9 feat: real-browser capture feeds SPA APIs into recon
- Playwright Chromium records same-origin XHR/fetch, JS bundles and cookie names
- raw capture saved under traffic/; compact endpoint block injected into recon
- scope/auth/evasion UA honored; 60s timeout kills node + Chromium group
- best-effort with NEUROSPLOIT_BROWSER_RECON=0 opt-out
2026-12-03 22:05:19 -03:00
Joas A Santos 40bfa2c9d3 Merge pull request #113 from JoasASantos/feat/wire-deterministic-gates
feat: wire-first deterministic gates (P0 refactor)
2026-12-03 16:18:04 -03:00
CyberSecurityUP fde91c0b74 feat: wire-first deterministic gates for sourcemap/admin/rate/IDOR
- replay a safe GET and store the real request/response as evidence
- sourcemap must be served and parse; admin rejects redirect/WAF/SPA/shell;
  rate/IDOR without a receipt become leads; generic findings go through judge
- only validated findings are reported; the rest are leads
2026-12-03 16:17:47 -03:00
Joas A Santos bec432d3a6 Merge pull request #112 from JoasASantos/fix/evasion-browser-ua
fix: --evasion uses a browser User-Agent
2026-12-03 11:30:32 -03:00
CyberSecurityUP 207be99ebe fix: --evasion uses a browser User-Agent (harness + tool recon)
- default UA is the browser UA under evasion; explicit NEUROSPLOIT_UA still wins
- browser Accept/Accept-Language; scan header stays dropped
- recon curl/katana/nuclei/ffuf carry the same UA
2026-12-03 11:30:22 -03:00
Joas A Santos 821742ce7f Merge pull request #111 from JoasASantos/fix/model-select-race
fix(web): model selection race and stale custom id
2026-12-03 11:16:39 -03:00
CyberSecurityUP 7e8110350d fix(web): model selection race + stale custom id override
- live catalog no longer re-applies the old/default model after the operator
  changed it while the fetch was in flight
- custom provider:model is cleared when it conflicts with the selected provider
- model card, selects and run body stay in sync
2026-12-03 11:16:20 -03:00
Joas A Santos 48fe6182b7 Merge pull request #110 from JoasASantos/fix/console-continue-newtab-grep
fix(web): Continue state, open run in new tab, portable recon grep
2026-12-03 11:09:59 -03:00
CyberSecurityUP 2173ac8930 fix(web): continue phase + run deep-link/new-tab; portable recon grep
- replace GNU grep -P in recon with perl (macOS/BSD)
- pause/continue sets phase running and recognises the CLI's resuming lines
- runs open in a new tab via ?run=<id>, Ctrl/Cmd/middle-click or the new link
2026-12-03 11:09:52 -03:00
Joas A Santos 3cda602f42 Merge pull request #109 from JoasASantos/fix/report-validated-only
fix: report only validated findings (candidates become leads)
2026-12-03 10:02:10 -03:00
CyberSecurityUP e9cb75128d fix: report only validated findings; keep candidates as leads
- validate_with_persist returns validated only; needs-review/rejected go to leads.json
- web reloads findings.json at job completion so the final table is the validated list
- no more agent-recorded candidates counted as High/Medium findings
2026-12-03 10:01:45 -03:00
Joas A Santos 6961466c03 Merge pull request #108 from JoasASantos/fix/settings-reactive-prefill
fix(web): apply Settings Engine choice to the wizard
2026-12-03 09:37:37 -03:00
CyberSecurityUP b29917381f fix(web): apply Settings Engine (reactive/phased) to the wizard
- choosing Phased in Settings now unchecks the wizard Reactive engine box
- avoids the checkbox default re-enabling reactive and skipping tool recon
2026-12-03 09:37:30 -03:00
Joas A Santos b35bfb15c5 Merge pull request #107 from JoasASantos/fix/cap-pinned-agents
fix: apply --max-agents to pinned agents
2026-12-03 09:36:18 -03:00
CyberSecurityUP 8ce411d060 fix: apply --max-agents to pinned agents
- pinned sets no longer bypass the cap (252 pinned + /agents 3 now runs 3)
- log the dropped count and make the REPL banner show the cap
2026-12-03 09:34:57 -03:00
Joas A Santos 83989ad1c1 Merge pull request #106 from JoasASantos/fix/settings-saved-model
fix(web): Settings saves the selected model (live catalog)
2026-12-03 09:28:32 -03:00
CyberSecurityUP 80748b0c74 fix(web): keep the saved default model after the live catalog loads
- the saved model can exist only in the live /models list, not the seed
  list; the select fell back to the first model and Save persisted it
- Settings and the wizard now re-select the saved/preferred model after the
  live catalog replaces the options
2026-12-03 09:28:15 -03:00
CyberSecurityUP 53cef9e5a9 fix(web): authentication button always opens the Target login tab
- reset the Auth & Keys tab on every open instead of keeping the last one
- Authentication -> Target login, rules -> Scope, infra creds -> Files
2026-12-03 09:23:06 -03:00
Joas A Santos e66ba3c1aa Merge pull request #104 from JoasASantos/fix/admin-false-positive-evasion
fix: /admin WAF/SPA false positives + evasion prompt
2026-12-02 22:35:45 -03:00
CyberSecurityUP 4e61368f16 fix: collapse and reject /admin WAF/SPA false positives; evasion prompt
- evasion prompt no longer instructs agents to send X-NeuroSploit-Scan
- inject WAF bypass doctrine whenever a CDN/WAF is detected
- admin guard: 3xx/block/SPA/public-JS routes are not exposed admin
- dedup admin claims across agents; reject redirect/identical-baseline claims
- web: do not add --agent-tools twice
2026-12-02 22:35:32 -03:00
Joas A Santos e52204b430 Merge pull request #103 from JoasASantos/fix/waf-200-block-page
fix: reject HTTP 200 WAF block pages (admin false positive)
2026-12-02 22:01:13 -03:00
CyberSecurityUP 9e64896631 fix: treat HTTP 200 WAF block pages as edge responses and reject them
- Cloudflare can serve the block page with 200; classify it via the specific
  'Sorry, you have been blocked' / 'Cloudflare Ray ID' wording
- judge_evidence rejects findings whose attack exchange is edge-blocked or
  throttled (the app was never tested)
- regression test for the 200 block page
2026-12-02 22:01:00 -03:00
Joas A Santos 65972fc4b2 Merge pull request #102 from JoasASantos/fix/recon-timeout-toolcall-neo4j
fix: recon timeout leak, tool-call reply recovery, Neo4j circuit-break
2026-12-02 21:40:18 -03:00