Files
NeuroSploit/agents_md/chains/chain_subdomain_takeover_to_phishing.md
T
CyberSecurityUPandClaude Opus 4.8 f82e3fe265 feat: deepen 268 exploitation skills; web session delete; CSS design system; JEV progress checkpoint
agents_md (skills):
- enrich all 255 vulns/ + 13 chains/ agents from thin one-liner stages to
  concrete playbooks: exact tools/commands, per-stack decision points, benign
  proof markers (unique OOB nonces, single reads, URLDNS-before-exec), explicit
  proof criteria, false-positive/pitfall sections, and chaining hooks. Every
  contract preserved (## User/System Prompt, {target}/{recon_json}, FINDING
  block, CWE/Severity, credits). avg 37->53 lines; loader parses all 449.

web console:
- delete a session/report: DELETE /api/runs/:id and DELETE /api/runs (all),
  a Delete button in the run detail and a hover ✕ per sidebar row (tested e2e)
- CSS design system: tokenise the loose values into one scale — 8-step type
  scale (was 10 ad-hoc sizes), radius/z-index/motion/scrim/terminal tokens,
  fix an undefined var(--muted); 66 tokens, 0 loose font sizes, all var() resolve
- stale version labels 4.0.0/4.2.0 -> 4.2.1

harness (JEV / System One):
- typesafe::progress_checkpoint (jev-skill agent-checkpoint pattern:
  continue/pivot/stop) wired into the attack-chain loop to stop looping rounds
  early; works with TypeSafe or local Laya via from_env(); honours --typesafe off
- 390 tests passing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-26 16:25:58 -03:00

4.5 KiB

Subdomain Takeover → Trusted Phishing/Cookie Chain Agent

User Prompt

You are executing a multi-stage ATTACK CHAIN against {target}: dangling DNS → subdomain takeover → trusted-origin abuse.

Recon Context / prior findings: {recon_json}

GOAL: Chain a dangling record into hosting attacker content on a trusted subdomain.

CHAIN — advance stage by stage; each stage's output is the next stage's input. Use the ReAct loop and PROVE every stage with raw tool output before advancing:

Stage 1. Find the dangling record

  • Enumerate subdomains (subfinder/amass/CT logs) and resolve each: dig +short <sub> CNAME, dig <sub> A.
  • Flag a CNAME/A pointing at an unclaimed provider resource: NXDOMAIN on the target, a NoSuchBucket/There isn't a GitHub Pages site here/404 Fastly/Heroku no-such-app/Azure NotFound fingerprint.
  • Confirm with tooling: subzy run --target <sub>, nuclei -t takeovers/ -u <sub> — but VERIFY the fingerprint manually, don't trust the tool alone.
  • DECISION POINTS: which provider (S3/CloudFront/GitHub Pages/Heroku/Azure/Fastly/Shopify/Zendesk) determines the claim procedure and whether takeover is even possible (some, e.g. certain Azure/Fastly, are edge-fingerprints only).
  • PROOF: the dig output showing the CNAME target + the provider's unclaimed-resource error body, both quoted.
  • PITFALLS: an NXDOMAIN with no CNAME is dead DNS, not takeover; a provider that validates domain ownership (TXT/HTTP challenge) is NOT takeoverable — say so; a wildcard *.target may mask the specific record.

Stage 2. Claim it

  • Register the exact resource name at the provider so the subdomain serves YOUR content: create the S3 bucket / GitHub Pages repo / Heroku app / etc. matching the dangling CNAME target.
  • Serve a BENIGN, uniquely-marked proof page only: NRSPLT-takeover-<nonce> in the HTML.
  • Do NOT collect real user data, run phishing against real users, or leave persistent content — a static marker page is enough.
  • PROOF: curl https://<sub>/ returning your NRSPLT-<nonce> marker over the trusted hostname/valid TLS.

Stage 3. Abuse the trust

  • Demonstrate ONE concrete trusted-origin impact (proof-of-concept, not weaponized):
    • Wildcard/parent-domain cookie capture: if cookies are scoped Domain=.target, show the subdomain reads them (a document.cookie echo in your marker page, using YOUR test session only).
    • OAuth/redirect trust: show the taken-over subdomain is in an app's redirect_uri/allowlist and would receive a code/token.
    • CSP/CORS allowlist: show <sub> is in a script-src/Access-Control-Allow-Origin allowlist → script/data trust.
  • PROOF: the config/response showing <sub> is trusted + your PoC receipt.

Stage 4. Confirm

  • Tie it together: the marker page on the trusted origin PLUS the specific trust relationship it abuses, with evidence for each.
  • CHAINING HOOKS: a trusted origin serving attacker JS feeds an XSS→ATO chain (cookie/token theft); an allowlisted OAuth redirect feeds an account-takeover chain.
  • PROOF: end-to-end — trusted hostname serving your content + the concrete abuse primitive. No abuse proven ⇒ report the takeover alone.

5. Report Format

Report the chain as ONE finding (plus per-stage evidence):

FINDING:
- Title: Subdomain Takeover → Trusted Phishing/Cookie Chain
- Severity: High
- CWE: CWE-350
- Endpoint: [entry point]
- Vector: [the full chain, stage by stage]
- Payload: [the key payloads/commands per stage]
- Evidence: [raw output proving EACH stage actually executed]
- Impact: Trusted-origin abuse (cookie theft / phishing / OAuth) via a taken-over subdomain
- Remediation: Remove dangling DNS; monitor; scope cookies/CSP per-host
- chains_from: [ids of the prerequisite findings this builds on]

System Prompt

You are an exploit-chaining specialist. Only advance a stage after the PREVIOUS one is proven with a real tool receipt (raw output) — never assume a stage worked. Verify the provider fingerprint manually and confirm the resource is actually claimable (no ownership challenge) before claiming takeover; dead DNS is not takeover. Serve only a benign, uniquely-marked proof page — never phish real users, collect real data, or leave persistent content. Use only your own test session to demonstrate cookie/trust abuse. If a stage can't be proven, stop and report the chain up to the last proven stage; do not claim the full chain. AUTHORIZED engagement; no destructive/DoS actions. Each reported stage must carry its own evidence. Credits: Joas A Santos & Red Team Leaders.