Commit Graph
265 Commits
Author SHA1 Message Date
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
d50209482d Fix the six defects behind a run that found nothing (#138)
* fix(select): cap a pinned set by recon fit, not by catalogue order

A run against a Cloudflare-fronted JS site pinned 232 agents with
--max-agents 3. The three that ran were a Java RCE detector, a PHP
webshell exploit and a cleartext check. Replaying that run's own recon
through the ranker puts them 223rd, 245th and 115th of 265.

Three defects, each of which alone was enough:

- `cap_pinned` truncated the pinned list, so the survivors were decided
  by position in the catalogue. Ranking by recon fit now decides, and
  the cap is still honoured. A pinned set that fits under the cap keeps
  the operator's exact order.

- `has_java` tested `recon.contains("java")`, which "javascript"
  satisfies. Every page with a script tag read as a JVM service, so the
  "no Java here" exclusion could never fire. `has_ai` had the same shape:
  a bare "ai" is inside "domain" and "mail".

- The run reported "intelligently selected N agent(s) matching recon" on
  the pinned path, which by design skips recon-based selection. It now
  names the decision that produced the list.

An agent the recon does not support still runs when pinned — the
operator named it — but is now called out, with what to change.

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

* fix(run): the five other defects the evidelo run exposed

One run produced 0 validated findings. Each of these contributed.

Provisioning was never reached. `provision` was gated on
NEUROSPLOIT_PROVISION alone, a flag the REPL does not pass, so a
sandboxed run announced "auto-installs tools" and then spent its rounds
discovering gau, subfinder and amass were missing — telling the operator
to "pass --provision" for an install it was free to perform inside a
throwaway container. A sandbox is now sufficient; the host still needs
the explicit flag.

Provisioning never checked its own work. Every install ended in
`2>/dev/null; true`, so "📦 provisioning Kali recon tools: …" was a
promise with no result. It now re-checks and reports what landed.

A reasoning-only reply lost the agent's turn. `cleartext_transmission`
spent its turn inside <thinking> and <thought> deciding to run curl and
stopped. That carries none of the markup `looks_like_tool_call` knows,
so the existing recovery never fired and the operator was told the model
"may have produced malformed JSON" — the wrong diagnosis. Such replies
now route to the same recovery, named correctly. The JSON scanner also
reads past reasoning blocks, and still finds JSON that only exists
inside one.

An unreadable verdict counted as a rejection. `vote()` returned
(confirmed, total), so a validator answering with prose and one reading
the evidence and saying no both arrived as `0/1`. With the one-model
panel this run had, that difference decides everything. The tally now
keeps the three answers apart and says "validator gave no verdict".

Pool health named providers the run never called. `FailoverChain::from_env`
walked a hand-kept list of eleven provider names that does not include
orcarouter — the provider this run used — so it reported anthropic,
deepseek and ollama all `[Closed] reqs=0` and nothing about the one
doing the work. It now walks the provider registry, which covers
console-registered providers too, and an untouched provider is listed as
unused instead of as pool health.

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 00:58:55 -03:00
Joas A SantosandClaude Opus 5 6cf9ffd5ed feat(chat): ask about the engagement, with its own records as context
The REPL is a slash-command console and `run` is a whole engagement. Neither
answers "what did we find on this target, and what should I look at next" —
the question an operator asks most and currently answers by reading JSON out
of runs/.

Add `neurosploit chat`: a JSON request on stdin, JSON lines on stdout, so
neither side parses prose. It goes through ModelPool, so it inherits the
keystore, the custom provider profiles and the cost ledger rather than
speaking HTTP on its own.

References resolve from disk before the model sees anything. @run pulls a
run's findings, @finding searches titles and endpoints across every run,
@target lists the runs against one. The resolver emits what it resolved AND
what it could not, because a reference that silently vanishes reads as the
model simply not knowing — and a model with no records will answer from the
shape of the question instead of the engagement.

Verified against a real run: with the reference resolved it quotes the
findings' exact titles and the token in their evidence; with the reference
missing it says it has no records rather than describing what such a finding
usually looks like.

The system prompt drops the definitions and the authorization warnings. The
operator is running the engagement and scope is enforced elsewhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 14:41:09 -03:00
Joas A SantosandClaude Opus 5 c89725c013 feat(cli): neurosploit provider — register any endpoint without editing source
key add --base-url --name registers a plain OpenAI endpoint on a direct
connection. The profile added alongside it carries proxy, session header,
user agent, rate limits, context window and pricing, and none of that was
reachable from the CLI.

Add a provider subcommand: list, show, add, remove.

add merges rather than replaces, so changing one setting leaves the rest
alone — the same reason register merges. show prints what is set and what
falls back, including that pricing left unset means the cost ledger guesses
from the model name, which tells it nothing about a private gateway.

list marks each provider with whether its key is set, and whether it is
proxied, priced or rate-limited, so a misconfigured one is visible without
opening it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 14:35:48 -03:00
Joas A SantosandClaude Opus 5 a00c856960 feat(providers): full custom provider profiles, not just a base URL
The registry held {name: base_url}. That covers an endpoint speaking plain
OpenAI over a direct connection — most of them, and none of the awkward ones:
a gateway wanting its own session header, an endpoint only reachable through a
SOCKS proxy, a model whose price the cost ledger cannot guess from its name, a
tenant whose rate limit sits far below the provider's published one.

Add CustomProvider: base_url, wire format, model list, proxy, session header,
user agent, rps/rpm, context window, and four prices. Entries written as a
bare URL string still load, so an upgrade does not lose anyone's providers,
and `register` now merges rather than replaces — editing the URL from the CLI
no longer drops a proxy and pricing set elsewhere.

Every field changes behaviour; none is stored for display:

  proxy and user_agent    build a per-provider reqwest client, cached on the
                          settings so an edit takes effect without a restart
  session_header          carries a per-process id, for gateways that pin
                          prompt-cache routing on one
  models                  reaches the Provider, so pickers can offer them
  price_*                 overrides pricing_for, which otherwise guesses from
                          the model name — and a private gateway's model name
                          says nothing about what the operator is billed

A proxy that reqwest rejects does not fall back to a direct connection. It
points at a dead local port and says so, because silently leaving the proxy is
the one outcome an operator routing through one cannot afford. Malformed
proxies and unknown wire formats are refused at save time.

Seven tests, including that a bare-URL registry still loads and that
registering a URL keeps the rest of the profile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 14:31:10 -03:00
Joas A SantosandClaude Opus 5 90bd20f143 fix(pipeline): keep the run futures Send so the binaries compile again
Neither binary has compiled since traffic recording landed. The release
binary on disk was three weeks older than the source, which is why.

At the end of run(), traffic_record::store() returns a std::sync::MutexGuard
that stayed alive across the tx.send(...).await two lines below. A MutexGuard
is not Send, so the enclosing future is not Send, and both app/src/main.rs
and app/src/tui.rs hand these futures to tokio::spawn, which requires it.

The library kept building clean throughout: nothing in it spawns a run, so
cargo check -p neurosploit-harness never saw the problem. That is the whole
reason this went unnoticed — every check I ran this session was scoped to the
library.

Scope the guard so it drops before the await.

Add a Send assertion over all six run futures. Reverting the scope fix makes
it fail with "future cannot be sent between threads safely", so it catches
the real thing rather than restating it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 14:18:42 -03:00
Joas A SantosandClaude Opus 5 bc0ee6ca27 test(skills): drive the catalogue through several rounds, not one call
Every test written for the exploration work so far checks a single call to
route. That proves a round can be selected; it does not prove the loop
advances, which is the thing the loop exists for and the thing that was
broken three separate ways this week.

Add a walk that drives the catalogue on disk the way exploration_loop does:
start at round 1, route, record what ran, feed findings back, go again under
the same budget and gates. On a typical web recon it reaches three rounds —

  round 1  no capabilities yet, recon-driven: sqli_error, idor, jwt_manipulation
  round 2  the SQLi minted admin_access, credential, internal_host, so
           sqli_union and sqli_blind arrive by declared chain while
           cloud_iam_privesc and container_escape arrive by capability alone
  round 3  privilege_escalation chains to exposed_admin_panel and
           account_takeover_chain; ssrf and auth_bypass by capability

Three tests: that it runs more than one round and no round repeats the one
before it, that rounds finding nothing wind the loop down rather than paying
for skills on stale recon, and that max_rounds holds under a productive run.

The findings are synthetic, so this proves the machinery advances and stops
where told. It does not show the selections pay off against a real target —
that still needs an engagement with API keys and something to point at.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 13:09:47 -03:00
Joas A SantosandClaude Opus 5 1de3002d49 fix(skills): stop minting held capabilities from merely reported weaknesses
Seven of the nine capabilities assert the tester HOLDS something — a
credential, a shell, files read. capabilities_from minted them on a keyword
hit anywhere in a finding's title, impact or evidence, so "the cmd parameter
is vulnerable to command injection" minted rce exactly as a demonstrated
shell did. Downstream that sends privilege_escalation and container_escape
after a shell nobody has, and those skills burn a round each.

Gate the seven on a two-sided read. An explicit achievement verb — executed,
recovered, dumped, obtained — settles it; failing that, hedged phrasing
blocks. Both sides are needed because the two co-occur constantly: a confirmed
finding's impact paragraph is normally written in "an attacker could" terms,
so hedging alone would suppress real achievements. A finding already marked
validated passes however it reads.

internal_host and endpoint stay ungated. They state what was revealed rather
than what was seized, and a verbose error disclosing 10.42.7.19 discloses it
whether or not the finding hedges about what that enables.

Five tests covering both directions: that a reported weakness no longer mints
rce, that a demonstrated shell still does, that an achievement verb outweighs
hedged impact prose, that a validated finding is taken at its word, and that
disclosure capabilities are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:36:33 -03:00
Joas A SantosandClaude Opus 5 ec656c1ada feat(skills): have a model read what findings yielded, alongside the keywords
capabilities_from matches keywords over a finding's title, impact and
evidence. It misses a credential phrased in words the list does not carry, and
it mints rce from a finding that merely warns command injection is possible.

Add a second reader. capabilities_via_model shows a model the findings and the
nine-name vocabulary and asks what the tester can now do that they could not
before, with the distinction stated: a parameter reported vulnerable to
command injection is not rce, a command whose output is in the evidence is.

The two are unioned, never substituted. Only names from CAPABILITIES survive —
anything the model invents is dropped — and a failed or refused call leaves
the keyword result standing, so the read can only widen what was already
derived. Off with NEUROSPLOIT_CAPABILITY_READ=off, and skipped once the USD
budget is in wrap-up, since it is one call per round.

Fixes a latent bug the new tests surfaced: SkillMeta derived Default, giving
max_rounds 0, while the field's serde default is 2. The key-value frontmatter
parser starts from Default::default() and fills in only the keys a file names,
and route drops any skill that has reached its max_rounds — so a skill whose
frontmatter omitted the key loaded with 0 and was silently unroutable. No
shipped skill omits it, so nothing was broken in practice, but the next one
written would have been. Default is now written by hand to agree with serde.

Five tests: that only vocabulary names survive the filter, that an unusable
reply cannot narrow the keyword result, that route uses supplied capabilities
rather than re-deriving them, that frontmatter without max_rounds is still
routable, and that the two defaults cannot drift apart again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:30:31 -03:00
Joas A SantosandClaude Opus 5 5393464134 feat(skills): chain on what a finding yields, not only on declared edges
Chaining ran entirely off `chains:` — skill A names skill B. That is a fixed
graph, so it only carries escalation paths somebody wrote down in advance. A
credential recovered by a skill nobody thought to draw an edge from reached
nothing, and the loop stopped at the end of whatever path was drawn.

extract_intel already mined credentials, secrets, internal hosts and endpoints
out of findings, but only to append as text to the recon context, where it
fired a skill solely if one happened to carry a matching trigger. The CWE
match was worth 5, under the 15 gate, so it could never promote anything on
its own.

Add a `consumes` field over a closed vocabulary of nine capabilities, and
derive from each finding what it actually yielded. Derivation reads the
finding's own fields and prose, not its agent's name, so a credential counts
the same whether default_credentials or sqli_union turned it up. A match is
worth 20, enough to clear the gate alone, because the point is that an
unforeseen path can start a round by itself.

72 skills declare what they consume. On a UNION SQLi yielding credentials, admin
access and an internal host, round 2 now reaches cloud_iam_privesc,
container_escape and exposed_admin_panel — none of which sqli_union names.

Five tests, three on the catalogue on disk: that a credential from a skill
declaring no chains at all still reaches credential-consuming skills, that a
disclosed internal host does the same, that a capability match clears the
round gate, that an empty finding set mints nothing so the anti-flooding
guarantee holds, and that every declared capability is one the deriver can
actually produce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:23:23 -03:00
Joas A SantosandClaude Opus 5 d9f540fb37 feat(skills): frontmatter for the remaining vulns; 480 of 530 covered
173 more skills, 218 chain edges: API and GraphQL surface, auth and session,
client-side, request smuggling and caching, exposure and misconfiguration,
IIS and ASP.NET, supply chain, business logic and payments, Kubernetes and
container runtime, and the LLM skills under vulns/.

Cloud and Kubernetes skills take the modes that reach that surface rather than
web alone, so a host engagement that lands on a kubelet can follow it.

Some carry chains but no triggers: poc_developer, cve_poc_finder,
cve_exploit_scripter, cve_research_analyst, postgres_superuser_rce,
clickjacking_poc, csrf_poc. They elaborate a finding that already exists —
selecting them off recon would have them write a proof for a vulnerability
nobody confirmed, or attempt RCE with no injection in hand.

The generator's stoplist rejected five triggers too common to discriminate:
'header', 'log', 'file', 'error', 'model'. Replaced with terms that do.

meta/ (24) and chains/ (22) stay without frontmatter, and a test now pins
that: meta/ is orchestration roles and pipeline utilities, so triggers there
would have the exploration loop launch the reporter as an exploitation agent;
chains/ is recipes attack_chain consumes on its own path, so triggers would
fire the same recipe twice. A second test requires the mode-specific
categories to declare their modes, since a routable skill naming none fires in
every engagement.

The three ai/ copies of names that also live in vulns/ stay bare on purpose:
dedup keeps the copy carrying the metadata, and giving both frontmatter would
make that choice arbitrary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:10:08 -03:00
Joas A SantosandClaude Opus 5 5db5cffab5 feat(skills): mobile, binary and AI frontmatter; dedupe colliding names
Three skills ship under the same name in two category directories:
llm_system_prompt_leak, llm_jailbreak and llm_excessive_agency each exist in
vulns/ and ai/. Both copies reached the catalogue, so route could pick the
same skill twice, and by_name — built by collect — resolved to whichever came
last. For llm_system_prompt_leak that meant get() returned the bare ai/ copy
while chain_map had been built from the vulns/ copy carrying the frontmatter.

load_catalog now keeps one copy per name, preferring the one that declares
routing metadata and falling back to the higher priority.

Frontmatter for 64 more skills, 108 chain edges. The binary_* skills are
scoped to mobile, host and whitebox rather than mobile alone: they analyse any
compiled artefact, and a host engagement that harvests a Windows binary should
reach them.

The twelve redteam_* skills carry chains but no triggers. They are jailbreak
strategies rather than findings, so recon must not select them directly;
llm_jailbreak chains into them once there is a guardrail worth pushing on.

307 of 530 skills now carry frontmatter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:05:18 -03:00
Joas A SantosandClaude Opus 5 de6ba6d63d feat(skills): scope skills by engagement mode, cover 152 more
load_catalog loads all ten category directories whatever the engagement is,
and route never looked at a skill's category. So giving code_sqli the trigger
"sql" would have launched a source-review agent during a black-box web run
against a target with no source to read, and the AD skills would have fired on
any recon mentioning ldap or smb.

Add a `modes` field. A skill that names its modes runs only in those; one that
names none runs anywhere, which is what the 91 skills from the previous change
rely on. The mode comes from the same string each site already passes to the
coverage ledger.

Frontmatter for 152 more skills, 179 chain edges: recon discovery feeders,
container image scanning, Active Directory, Linux and Windows local privesc,
AWS, GCP and Azure, and the 84 source-review skills scoped to whitebox and
greybox. 243 of 530 now carry it.

Priority was being added unconditionally, so any skill at priority >= 30
scored 15 with nothing matching and cleared the gate on an empty recon. The
field documents itself as ordering skills that are "equally triggered" — a
tiebreaker — so it now applies only once a skill has matched. An anti-flooding
test on meaningless recon caught this.

Six tests on the catalogue on disk: that a web run never picks source-review
or host skills, that whitebox and host runs do reach theirs, that nothing
fires on meaningless recon in any mode, and that every chain edge resolves.
The generator refuses triggers under two characters or on a stoplist of terms
too common to discriminate, which rejected five on the first pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:52:58 -03:00
Joas A SantosandClaude Opus 5 5cea33740e fix(skills): stop the opening selection from spending the exploration budget
Two limits kept the exploration loop from running even once frontmatter made
its skills routable.

skills_ran is seeded with the agents the opening selection already ran, so it
serves two purposes at once: dedup, and the meter for max_total_skills. That
default is 20. Measured across 17 recorded engagements, 7 opened with 20 or
more agents — two with 232 — so next_round returned empty on its first call
and the loop broke before launching anything. Count the skills this loop
launched separately and budget against that; skills_ran keeps doing dedup.

The round guard was off by one. round starts at 1 and the guard read
`round >= max_rounds`, so max_rounds: 3 gave two rounds. Now `round >
max_rounds`, and 3 means 3.

Updates max_rounds_respected, which asserted at round 1 and so encoded the
off-by-one; it now asserts at round 2, keeping its intent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:21:35 -03:00
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 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 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 00c5c87bff feat: add traffic store for browser captures (#115) 2026-12-03 22:48:50 -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
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
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
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
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
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
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
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
CyberSecurityUP de41c9769b fix: kill leaked recon pipelines, recover tool-call replies, Neo4j circuit-break
- host recon runs in its own process group and SIGKILLs the group on timeout (gau/katana no longer outlive the run)
- when an agent replies with tool-call markup instead of JSON, ask once for a JSON-only answer over the same evidence
- remember an unreachable Neo4j for the process so later graph phases skip it silently
- warn when many agents are pinned with --max-agents 0 and when vote-n exceeds distinct models
2026-12-02 21:40:07 -03:00
CyberSecurityUP fe98870c0e feat: add OrcaRouter provider and two-step default model picker
- OrcaRouter (api.orcarouter.ai/v1, ORCAROUTER_API_KEY): registry,
  sk-orca- prefix detection, auto-config, web catalog + key verify
- Settings > Defaults: provider -> model, listing only usable providers,
  with the live model catalog
2026-12-02 20:56:51 -03:00
CyberSecurityUP 20676c3b56 feat: classify AD/host receipts in the phased pipeline
- add ad_evidence::classify_auto (all tool families, deduped by fact)
- persist receipts to graphs/ad-facts.json via ad_recipe::record and read
  them in facts_from_run
- classify recon/tool output, every agent transcript, and each chain
  round so the AD/privesc recipe chain advances in the phased pipeline
2026-12-02 15:15:41 -03:00
CyberSecurityUP d2e464ff4f fix: CLI/web parity for auto-config opt-outs; AD facts from dual graph
- add --no-revalidate / --no-evasion / --no-sandbox for CLI parity
- web resume preserves sandbox/reactive/revalidate/evasion and forwards
  the NEUROSPLOIT_NO_* opt-outs
- autoconfig no longer overrides explicitly-set env (including 0)
- ad_recipe facts_from_run reads dual-graph.json as well as reactive-state
2026-12-02 15:04:11 -03:00
CyberSecurityUP 2ed7ec6a51 fix: reactive seeds target from prose recon; add --no-reactive off switch
- add_recon always seeds the target asset and extracts in-scope URLs /
  subdomains from free text, so a prose recon answer no longer leaves the
  graph empty (which made the planner quiesce with 0 findings)
- --no-reactive / NEUROSPLOIT_NO_REACTIVE=1 and unchecking the web toggle
  now actually disable reactive and fall back to the phased pipeline
2026-12-02 14:44:32 -03:00
CyberSecurityUP 60f6b40fc9 feat(web): surface auto-config defaults in the wizard
- PoC re-validation and OPSEC evasion default on; sandbox defaults to Auto
  (Kali if available)
- unchecking a default or picking "This host" sends the matching
  NEUROSPLOIT_NO_* opt-out so the front-end choice wins
- wire --evasion into run/session args; drop the duplicate More options toggle
2026-12-02 13:15:59 -03:00
CyberSecurityUP bf4c31dacb feat: auto-config safe defaults, live model catalogs, CVE/AD in flow
- autoconfig enables reactive (Black), models, tools, MCP, economy, PoC
  re-validation, OPSEC evasion and an already-present Kali sandbox, each
  with a NEUROSPLOIT_NO_* opt-out; authorization/safety stays explicit
- CVE lookup folded into pipeline/reactive recon (no separate cve command)
- AD/privesc recipes injected into agent prompts from run facts
- web: live model catalog for every provider plus a custom model id, and
  OpenRouter model ids fixed
2026-12-02 13:08:55 -03:00
CyberSecurityUP 2c0ac06735 feat: fingerprint→CVE lookup and host/AD privilege receipts
- cve_lookup: extract product/version fingerprints from headers/banners/nmap,
  look up known CVEs via an embedded high-signal index and optional NVD 2.0;
  CLI
- reactive worker: fingerprints in tool output add  facts to the graph
- ad_evidence: classify host privesc receipts (sudo NOPASSWD, SYSTEM,
  SeImpersonate, kernel CVE, SUID, AlwaysInstallElevated, unquoted service)
- prompt doctrine: look up CVEs the moment a concrete version is fingerprinted
2026-12-02 12:03:04 -03:00
CyberSecurityUP 983b00a1dc chore(release): v4.6.0 — MCP & C2 operator tools, installers, red-team engine 2026-12-01 23:58:34 -03:00
CyberSecurityUP b02f10569a feat(web): MCP & C2 operator tools + built-in profiles
- new MCP & C2 page under Operator tools: connect a C2 (profile / configured
  MCP server / HTTP URL) in a modal, list built-in C2 profiles (sliver/havoc/
  mythic/adaptix/cobaltstrike), test MCP servers with a real initialize+tools/list,
  add/remove custom MCP servers, and task reused sessions
- backend /api/operator/* routes proxying c2x and probing stdio/HTTP MCP
- CLI: neurosploit tools mcp profiles (+ json resolves C2 profiles)
- simplified captions, centered layout, sane empty states, single input focus ring
2026-12-01 18:58:31 -03:00
Joas A SantosandClaude Opus 5.5 aa89175a82 chore: use neutral example names in comments and tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:28:54 -03:00
Joas A SantosandClaude Opus 5.5 a1573d0e9c feat(web,harness): v5 console redesign, test-type-aware reports and graph
Web console
- New design system (dark/light), grouped sidebar, command palette, mobile app bar.
- Home quick-start with type detection, setup checklist, resumable wizard drafts.
- 4-step wizard with per-test-type fields, asset picker, depth presets and
  allow-listed "More options" CLI flags; agent step with surface/OWASP/category
  facets and per-type recommendations.
- Finding sheet: structured narrative, step-by-step PoC, white-box code viewer
  (real source, syntax colours, evidence-anchored vulnerable lines).
- Attack graph: type-aware lanes, compact nodes, per-node inspector, path focus,
  asset anchoring, decluttered overview.
- Chains, dependencies, traces, deliverables, projects portfolio, assets,
  toolbox, settings (single AI key, subscriptions check, Neo4j), scope & safety
  split (global vs per test) with engagement-authorization letter.
- Continuous testing for GitHub repos: PR/commit triage by security relevance,
  test only changes above a threshold.

Server
- Routes: subscriptions check, source excerpts, authorization letter,
  continuous testing, run flag allow-list.

Harness
- Test kind classifier (web/code/infra/mobile/ai/cloud) stamped on findings;
  kind-aware report layout and repro steps (no curl for AD/code).
- Report redesign; rejected findings no longer shown as confirmed;
  attribution sentence removed from findings.
- Evidence integrity accepts declared pivots; credential-exposure CWE floor.
- Graph memory anchors findings to the real host (IP + hostname, pivots).
- NEUROSPLOIT_AUTHORIZATION env for every run mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:27:55 -03:00
CyberSecurityUP 8aca22eeed feat(ops): collection, exfiltration and OPSEC/evasion
- collect: per-run collection manifest (size + SHA-256 + sensitivity), file
  staging/verification, and context checklists
- exfil: chunked HTTPS upload to an operator endpoint, size-capped and
  hash-verified, gated by the operator checkpoint (exfil id)
- evasion: OPSEC profile + fingerprint self-check; --evasion drops the
  X-NeuroSploit-Scan header to reduce attribution
- CLI: neurosploit collect|exfil|evasion
2026-12-01 14:23:28 -03:00
CyberSecurityUP 324d3d0507 feat(c2): HTTP MCP transport + C2 auto-tasking (any MCP C2)
- mcp_client: Streamable-HTTP MCP client (initialize/tools.list/tools.call,
  JSON or SSE, mcp-session-id) + a transport-agnostic McpTransport enum
- c2_reuse: sync via stdio OR http; auto-task a reused session with the C2's
  exec tool (per-C2 preferred tool, schema-aware arg mapping via inputSchema),
  gated by the operator checkpoint and recorded in activity
- c2x: sync --http/--header, task (execute through the best existing session);
  works for Sliver/Havoc/Mythic/Adaptix and any custom stdio/HTTP MCP server
- verified end-to-end with mock stdio and mock HTTP MCP servers
2026-12-01 14:15:53 -03:00
CyberSecurityUP bf44396522 feat(c2): generic MCP C2 session reuse (any stdio MCP, not just ours)
- mcp_client: minimal stdio MCP client (initialize/tools.list/tools.call),
  newline JSON-RPC, ${VAR:-default} expansion
- c2_reuse: import/normalize sessions from any C2 (Sliver/Havoc/Mythic/Adaptix/CS
  export shapes), pick the best existing session for a target, persist 0600,
  inject a reuse prompt block into chain/worker prompts
- c2x sync --profile <sliver|havoc|mythic|adaptix> or --command <stdio-mcp>:
  discovers the session-listing tool (sliver_sessions/havoc_demons/mythic_callbacks/
  get_live_beacons, or pattern), calls it, imports the result — provider-agnostic
- CLI: neurosploit c2x {sync,import,list,reuse,context}
2026-12-01 14:08:36 -03:00
CyberSecurityUP bb9fcbbb14 feat(pivot): health-aware route selection + auto-reroute
- select_route: longest-prefix subnet match, alive-only, SOCKS preferred at equal prefix
- find_pivot_for picks the most specific pivot subnet (/24 over /16)
- ensure_tunnel reuses the best alive route (port-proxy requires an exact forward)
- health_check_all probes each tunnel's local SOCKS/forward port and marks dead
  tunnels so the next chain round rebuilds instead of failing through a stale proxy
- route_for(target_ip, port) returns the per-host proxy/env; pipeline sweeps
  tunnel health at the start of each chain round
2026-12-01 13:58:51 -03:00
CyberSecurityUP 3a1612effd feat(checkpoint): operator gates for high-impact actions
- classify DCSync/ADCS abuse/delegation abuse/credential dumping/persistence/
  lateral exec/phishing launch/destructive commands
- enforcement off|record|enforce (default off); enforce blocks unless the action
  id is allow-listed (NEUROSPLOIT_CHECKPOINT_ALLOW / ALLOW_HIGH)
- gate in the agentic tool loop: blocked actions return an observation and are
  recorded in activity/audit; --checkpoints flag + checkpoint classify CLI
- no behavior change when off
2026-12-01 13:55:12 -03:00