Commit Graph
3 Commits
Author SHA1 Message Date
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 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
CyberSecurityUPandClaude Opus 4.6 d3a9726a74 feat(harness): CAG (Context-Augmented Generation) anti-hallucination pipeline
Agents behind WAF/CDN (Cloudflare etc.) were fabricating HTTP evidence
when curl returned challenge pages instead of real application responses.
This implements a full CAG pipeline that pre-collects HTTP evidence and
injects it into agent context, eliminating hallucinated findings.

CAG pipeline:
- cag_collect(): pre-fetches all discovered endpoints before agents run
  - Browser mode (Playwright headless) when WAF detected
  - curl mode for non-WAF targets
  - Collects status, security headers, response body per endpoint
  - Probes sensitive paths (.env, .git/HEAD, robots.txt, xmlrpc.php etc.)
- CagCache persisted to cag_cache.json in run directory
- CAG_DOCTRINE prompt: agents told to analyze provided data, not fabricate
- cag_grounding_gate(): post-agent cross-reference against cache, demotes
  findings where pre-fetched evidence contradicts agent claims

Integrated into 4 web-facing run modes:
- run() (main web engagement)
- run_greybox() (source + live)
- run_host() (infrastructure)
- run_ai() (AI/LLM endpoint testing)

Additional changes:
- WAF anti-hallucination gate: replay endpoints, demote if WAF blocks
- CF_BYPASS_EXPLOIT_HINT updated to reference CAG data
- max_tokens bumped to 32k for Claude models (output truncation fix)
- 7 new/rewritten agent files (ARTEX-level depth):
  - js_analysis.md, secret_scanning.md (rewritten)
  - chain_secret_to_takeover.md, chain_web_deep_exploit.md (new)
  - sourcemap_exposure.md, bypass_403.md (new)
  - java4shell_detect.md, php2shell_exploit.md, php2shell_scan.md (new)
- CHAIN_DOCTRINE: sourcemap harvest, transitive secret extraction
- Web UI improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgQHN9UbgqguQuyeND7PWF
2026-11-19 12:23:10 -03:00