Hunt: Auth Bypass & Account Takeover (golden-image rework)
Turn an auth surface inventory into evidence-carrying CANDIDATES for auth bypass and account takeover: legacy protocol doors, reset-flow poisoning, token shape flaws, session/MFA gaps, JWT manipulation. This skill produces candidates, never verdicts - findings leave ONLY through the G1 proof gate (triage).
Current emphasis (update on wiki harvest): IdP-redirect windows and parameter-name brute forcing on set-password endpoints - models over-index on over-represented old methods; the newest harvested technique leads until superseded.
Assumes hunt-core for the scope gate, two-account rule,
confirmation gate, enumeration limits, stop conditions, wiki protocol,
FIND output, and Deadends. Do not re-derive any of that here.
Wiki
Hub: [[web-moc]] - Primary page: [[authentication-attacks]] - Payload
arsenal: wiki/payloads/auth-bypass.md
Anchors: [[session-management-attacks]], [[jwt-attacks]],
[[cryptography-attacks]]
REFS: [[authentication-attacks]], wiki/payloads/auth-bypass.md
mcp__wiki-search__query (lex) "authentication bypass account takeover password reset poisoning session fixation legacy protocol" via wiki-search MCP - ONLY on a concrete hint the map above does not cover (a specific sink/version/CVE, an observed escape); not a blanket first step.
Shared bypass arsenal (blocked implies research, but walk this first): skills/exploit/hunt/hunt-auth/references/bypass-arsenal.md - Easy Auth /.auth/me probe, GraphQL sign-in type-coercion (password null/list), debug identity headers (X-User-Id class), single-packet races on reset/2FA/enroll flows.
Paths (binding - define once at the top of the run notes)
# seat side (wsl) - engagement tree is DOUBLE-NESTED in VMshare:
ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
RUN=$ENG_DIR/hunt/auth/<host>
# VM side (WHERE tools run, same tree through the VMware share):
ENG_DIR=/mnt/VMshare/<eng>/<eng>
RUN=$ENG_DIR/hunt/auth/<host>
Corpus and probes live in the VMshare tree; the VM runs tools against the /mnt/VMshare spelling as user tz; the seat reads the same bytes at the /mnt/c/Users/Lenovo/Desktop/VMshare spelling. The repo tree targets/ is admin/ingest only - probe artifacts NEVER land there.
Transport
Every VM-native command block ships through ONE documented transport:
cd /mnt/c/Users/Lenovo/Documents/ObisidianVaults/ZTorch/ZTorch && bash scripts/vm-ssh.sh '<command>'
- vm-ssh lands as user tz (NOT root): no root-only paths, no sudo.
- vm-ssh.sh takes the command as ONE argument. Commands containing
quotes ship as base64: write the script, then run
echo <b64> | base64 -d | bashinside the vm-ssh argument. - Non-login shells do NOT source profile.d: the PATH scope-shim is NOT active. Target-facing fetches MUST use the shim binaries by absolute path /opt/scope-shim/bin/{curl,httpx}.
- Shim verdict semantics (verified live): explicit out-of-scope host dies rc 126 (never work around it); in-scope passes; UNKNOWN hosts get an ADVISORY and the fetch proceeds - an advisory is NOT approval; verify against scope.md and self-deny anything not clearly in scope.
- Commands longer than ~2 minutes run DETACHED (bash scripts/vm-scan.sh '' or nohup + DONE-marker poll) - the direct bridge drops at ~2min and empty output then reads as a dead target.
Entry gate
All four must pass before Step 1; each is falsifiable:
Active engagement exists (repo tree targets//active.md) and is on the targets//scope.md in-scope list. Scope-guard is the deny. (targets/ is the repo admin tree; $ENG_DIR holds corpus and run artifacts only - see Paths.)
hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md - it owns scope gate, two-account rule, confirmation gate, enum limits; never restated here).
Producer verified - at least ONE of: (a) $ENG_DIR/state.md asset table has >= 1 auth-class endpoint row for (login/reset/session/JWT/legacy path);
(b) a caido baseline capture names the auth flow for ;
(c) the kickoff seeded $RUN/raw/auth-map.md. None = dispatch the surface lane first; never probe blind.Toolchain preflight (fails LOUD; fatal only on tools the chosen branch needs - nuclei is optional, fatal only for the nuclei branch):
for t in /usr/bin/jq /usr/bin/python3 \ /opt/scope-shim/bin/curl /opt/scope-shim/bin/httpx; do [ -x "$t" ] || { echo "MISSING TOOL: $t"; exit 1; } done [ -x /home/tz/go/bin/nuclei ] || { echo "MISSING TOOL: nuclei (install: sudo -u tz env PATH=\$PATH:/usr/bin/go HOME=/home/tz go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@v2.9.15)"; exit 1; }
Checklist (mandatory)
Copy checklist.md (this skill's dir) to
$ENG_DIR/hunt/auth/<host>/auth-checklist.md at run start. Tick boxes
as steps finish; unchecked at stop = UNCHECKED lane, re-run from the
first unchecked step. The SKILL.md text and the checklist header agree
byte-for-byte on that copy target.
Nudge
Review-skill re-injection text (pinned for vocabulary match; NOTE: the completion-gate script itself emits a different generic nudge - see scripts/completion-gate.py NUDGE - both strings mean the same thing: resume at the first unchecked box):
Your work was just reviewed by the review skill and it was found
that you either missed a step of analysis, or didn't generate an
artifact of sufficient proof. Look at the markdown based checklist
and the output for each step, find what you missed, and complete
that step.
On this nudge: resume at the FIRST unchecked box of $ENG_DIR/hunt/auth//auth-checklist.md - never restart the run from zero. REVIEW may only be ticked after every earlier box is ticked.
Methodology
Setup: two accounts per hunt-core (A attacker, B victim-target -
B is ALWAYS the operator's own second account). Drive load-bearing
requests through Burp/Caido (Skill(hunt-burp)): the poisoned
reset request and each JWT-tampered request to Repeater; the bounded
rate-limit/lockout probe to Intruder, never a hand-rolled loop.
scripts/capture.sh burp grabs the PoC the moment it lands.
Rank before testing (higher entry beats cleverer payload): legacy protocol doors first (a second door to the same credential store, frequently no rate limit/MFA/CAPTCHA), then reset-flow poisoning, session/MFA manipulation, then the form fields themselves (a login taking username only, no password field, is instant ATO - submit the privileged/target username), then key derivation oracles.
Step 1 - Auth entry-point map
Enumerate every authentication entry (main, admin, API, partner,
mobile) and identify the mechanism per entry (forms, SAML, OAuth, API
key, session). Row schema entry | mechanism | source:
{ \
echo "main | <mechanism> | <source: caido baseline / state.md / probe>"
echo "admin | <mechanism> | <source>"
} >> "$RUN"/raw/auth-map.md
Step 2 - Legacy protocol matrix sweep
Tech-match the target (headers/paths) and probe each matching legacy
endpoint ANONYMOUSLY (confirm reachable, not 403/404). Terminal state
per endpoint; row schema tech | endpoint | state | note:
for ep in xmlrpc.php _vti_bin/Authentication.asmx \
_api/contextinfo rest/auth/1/session \
EWS/Exchange.asmx vpn/index.html manager/html \
user/login; do
code=$(/opt/scope-shim/bin/curl -s -o /dev/null \
-w '%{http_code}' "https://<host>/$ep")
echo "<tech> | /$ep | $code | anonymous probe" \
>> "$RUN"/raw/legacy-matrix.md
done
Full matrix (carried): WordPress /xmlrpc.php (native WP creds; bypasses SSO, MFA, IP-allow on /wp-login.php); SharePoint /_vti_bin/Authentication.asmx (SOAP Login, FedAuth cookie, no rate limit observed) and /_api/contextinfo (anonymous FormDigest); Jira/ Confluence /rest/auth/1/session (native creds even under Atlassian Access SSO); Exchange /EWS/Exchange.asmx + /Microsoft-Server-ActiveSync (NTLM/Basic, bypasses OWA MFA); Citrix /vpn/index.html + /cgi/login (native AD creds independent of MFA wrappers); F5 /mgmt/tm/util/bash + /tmui/login.jsp; Spring Boot /actuator/*; Jenkins /jnlpJars/jenkins-cli.jar + /script; Tomcat /manager/html; Drupal /user/login?_format=json; generic ASP.NET *.asmx?WSDL + trace.axd + elmah.axd.
Bounded rate-limit verification (matrix step 4): test with synthetic credentials first - confirm differential (success vs failure). Verify NO rate limit against a synthetic or your OWN test account (never a real user - every failed attempt counts toward lockout): bounded burst - 5 default per hunt-core, 20 ceiling with operator approval, 0 under no_bruteforce - confirm uniform timing, no 429, no lockout counter. The ABSENCE of the limit is the finding; do not actually brute-force to prove it.
Step 3 - Form field read
Read the login/reset forms' FIELD structure, not just the endpoint:
username-only or token-only forms with no secret = instant-ATO signal.
Row schema form | fields | signal, appended to auth-map.md.
Step 4 - Reset-flow poisoning (OWN account only)
Vectors: X-Forwarded-Host: attacker-controlled host on POST /forgot-password; dual Host headers; absolute-URI request line. On a hardened flow vary the vector rather than repeating one form. Every attempt on the operator's OWN account; save full req/resp pairs.
Step 5 - Token shape + reuse/expiry (magic-link/OTP)
Obtain 2+ tokens (magic links, OTP codes) on the OWN account; diff their shape (entropy, structure, timestamp fields); test reuse after spend and expiry; bounded rate probe on the token-consuming endpoint (5/20/0 bounds). Token tests NEVER target another user's account.
Step 6 - Session/MFA
Fixation (set session cookie pre-auth -> persists after login), missing rotation on privilege change, MFA-optional endpoints (the endpoint that skips the MFA tier).
Session-state divergence (always test - the most under-tested session control): UI session transitions (logout buttons, 2FA/MFA interstitials, auth-failure bounces, pending-auth redirects) frequently change CLIENT state only - clearing cookies or rendering a login wall - while the SERVER session stays live. After every UI session-state change, replay the refresh grant to test what the server still honors. Logout is the canonical case: UI logout frequently revokes only the CURRENT session while a session minted through a second token path survives it. The recipe, own accounts only:
- Log in (session 1); mint a SECOND session through a different
token path - the public
/oauth/tokenrefresh grant, a second device login, or an API-key exchange - anything that yields an independent refresh token. - Perform the UI logout in session 1 exactly as a user would (button click, not an API call).
- Replay BOTH refresh tokens: bounded (2 replays ~5 min apart, never a loop). A surviving token still minting access tokens = the finding; the persistence window is the impact statement.
- NEGATIVE CONTROL (this is what makes it G1-grade): find the
logout-everywhere op the UI does NOT call (mine the bundles for
LogoutAllSessions-shaped operations; fire it via the normal API recipe with the surviving session's credentials) and verify it kills the surviving session. The contrast - server control exists, UI button unwired to it - is the finding's core claim, and without it the report reads as a feature request, not a bug. - Amplifiers to record alongside: token-bearing cookie httpOnly flag, SameSite, cookie lifetime (a JS-readable 30d refresh cookie turns the gap into persistent post-logout access for any XSS).
- Teardown: fire the logout-everywhere op, then replay every held refresh token and record 401s - no live session left behind.
- Same probe on NON-logout transitions: an opt-in 2FA interstitial the login lands on, or the redirect a login page bounces through, is the same divergence in another costume - probe authed ops and the refresh grant from the "pending"/"bounced" state before concluding any gate exists there. A 2FA page that never enforces (opt-in only, full session issued at landing) means account security rests entirely on the cookie - record that as the amplifier.
Registration on captcha-gated flows and disposable-inbox mechanics
for the two accounts: references/test-account-minting.md.
Step 7 - JWT manipulation (N/A: no JWT surface)
# 1. Decode JWT
echo "HEADER.PAYLOAD.SIGNATURE" | cut -d. -f2 | base64 -d 2>/dev/null | python3 -m json.tool
# 2. none algorithm: change "alg":"RS256" -> "alg":"none", strip signature
# 3. HS256/RS256 key confusion: RS256 token re-signed with the public key as HS256 secret
# 4. kid injection, weak secret (bounded, per hunt-core enum limits)
A JWT that decodes cleanly or that the server did not reject is NOT confirmation - send it and observe behavior (Confirmation gate below).
Step 8 - Email change without re-auth
PUT/PATCH /api/user/email with a new address and NO current_password; look for the change taking effect without re-authentication or confirmation round-trip.
Step 9 - SQL truncation duplicate-account (N/A: not a legacy
PHP/MySQL stack)
On a legacy PHP/MySQL stack (old Apache/PHP banner) with
self-registration: register admin+spaces+junk to forge a duplicate
privileged username, then log in as admin/yourpass - see
[[authentication-attacks]] "SQL Truncation Duplicate-Account Auth
Bypass".
Step 10 - Key-derivation oracle hunt (N/A: no per-user signing key)
When auth or a "signed message" rests on a per-user key: hunt /debug, docs, /about, or source for the key-derivation disclosure (deterministic seed like f(username, CONST), nextprime(int(SHA256( seed)))). If the derivation is known, reconstruct the private key offline and forge signatures/sessions/JWTs for admin - no factoring, modulus size irrelevant. Build + oracle-brute steps in [[cryptography-attacks]] ("RSA private key from a known/deterministic seed").
Step 11 - Exit artifact (candidates)
Merge probe JSONLs (union, truncate+dedupe on endpoint+method+class; keys class|host|endpoint|method|evidence| confidence|next). candidates.md: human table + probe counts, EVERY class section present ("no hits" where true; a missing class section = failed lane). Pointer $ENG_DIR/hunt-auth-.md:
AUTH-HUNT-DONE legacy=<n> reset=<n> tokens=<n> session=<n>
jwt=<n> emailchange=<n> truncation=<n> keyderiv=<n>
Plus: _requests.md rows (lane = hunt-auth), state.md asset rows (access=exploit-candidate, source=hunt-auth), Deadends rows with the WHY.
Every probe JSONL row: {class, host, endpoint, method, evidence (absolute probes/raw/ path), observed, confidence}. Every request/ response pair saved under $RUN/probes/raw/ (filename = sha256 of method+path+body).
ATO attack paths (priority order, carried)
- Password reset poisoning: POST /forgot-password with X-Forwarded-Host: attacker.com -> reset link sent to attacker
- Reset token in Referer leak: reset page loads external analytics -> full Referer with token leaked
- Email change without re-auth: PUT /api/user/email {"new_email": "attacker@evil.com"} without current_password
- Session fixation: set session cookie before auth -> persists after login
- IDOR -> ATO chain: PATCH /api/users/{victim_uid} with attacker session -> change victim email -> reset password (hunt-idor pairs here)
- Incomplete logout: UI logout revokes only the current session - refresh-grant sessions keep minting tokens post-logout (Step 6 recipe); pair with any token-theft primitive for persistence
Confirmation gate
NOT confirmation: a 200 on the login page or reset form; a different or friendlier error message; a password-reset email merely received; a JWT that decodes cleanly or whose alg/claims you edited and the server did not reject; a legacy endpoint returning 200 to an anonymous probe; the server "accepting" a modified token without acting on it.
IS confirmation: an authenticated session obtained as a DIFFERENT user - exercise a capability only that account has - OR a reset token that actually resets another account's password and lets you log in as them. Reproduced from scratch in a clean session (fresh profile, no cached cookies) per hunt-core, with your own account ruled out as the thing you logged into.
Chaining
- Reset poisoning / token leak -> ATO: report the chain, not the leak alone.
- Trusted JWT claim -> ATO: sub/user_id the server trusts + weak or strippable signature = arbitrary account takeover.
- hunt-federation for SSO/OAuth/SAML redirect_uri, state CSRF, XSW; this skill covers SAML auth-bypass surface only.
- hunt-idor for the trusted-identifier overlap (PATCH /users/{victim} rewriting a victim email chains straight back to reset-based ATO).
Evasion
When the primary login rate-limits or enforces MFA, the bypass is usually a DIFFERENT ENTRY POINT to the same credential store, not a cleverer payload: legacy endpoints, an alternate host (mobile/partner/API), an older API version, a SOAP/JSON variant of the same auth call.
When every door is guarded, the credential itself is the surface: [[default-credentials]] for the stack, then policy-shaped passwords (company word + year + symbol, Season+Year) mutated per [[password-cracking]] instead of a generic wordlist - bounded exactly like the rate-limit probe (5 default, 20 ceiling, 0 no_bruteforce). A confirmed username collapses the attack to password-only; never run a full user x password matrix when one name is known. Derive the exact password policy from registration/change-password errors first and filter candidates to it (grep filter chain in [[wiki/tools/hydra]] "Custom Wordlists"). Before any form attack, capture one real login attempt (devtools Network tab or Burp) to fix the POST path, param names, and one reliable F=/S= condition - a wrong params string fails silently.
Validation
- Proof = a working session/token for account B minted through the flaw, then REPLAYED to read B's data. Possession of a token shape is not access.
- Negative control: the identical flow with the flaw neutralized (correct OTP, original aud) fails.
- Counterevidence: OTP/device binding may enforce at a second tier (API gateway) even when the login tier folded.
False Positives
- Login-as-B using operator-provided second test creds: that is the two-account RULE, not a bypass.
- Missing rate limit alone, without one successful out-of-guess login.
- Null session "broken" because of an IP allowlist, not session logic.
- alg=none token ACCEPTED by your parser but rejected server-side (send it).
- Reset-token "reuse" that was actually a fresh token for the same account.
Cross-routing
- hunt-federation when the flow is SAML/OIDC/assertion based.
- hunt-m365 for AADSTS-coded Entra login flows and lockout math.
- hunt-api for bearer scope/audience problems on APIs.
- Not this skill: response poisoning delivering someone a session (hunt-cache).
Severity
Rated on demonstrated impact (per hunt-core), not the mechanism.
| Condition | Typical |
|---|---|
| Auth bypass reaching an authenticated context with no credentials | critical |
| Full ATO of a victim account (reset poisoning, trusted-JWT claim, session fixation) | critical / high |
| Full ATO requiring one victim click | high |
| Unlimited credential brute-force endpoint confirmed (legacy protocol, no rate limit) | critical / high |
| Legacy endpoint reachable, accepts native creds, no rate limit, no creds tested yet | medium |
Unauthenticated outranks authenticated. A precondition you cannot satisfy (a victim click, a cred list you do not hold) lowers it.
N/A escapes
- "N/A: no JWT surface"
- "N/A: not a legacy PHP/MySQL stack"
- "N/A: no per-user signing key"
- "N/A: nuclei absent on VM" (optional tool; hard MISSING after install-line gate)
- "N/A: no legacy endpoints matched" An N/A tick is a claim with a reason, never a silent pass. Identical strings in SKILL.md and checklist.md.
Bitter-pill variant
When the kickoff designates this run freehand: skip the checklist copy and numbered steps, one freehand pass over the auth surface, output lands ONLY in $RUN/analysis/bitter-pill.md (tried / found / dismissed, every claim carries file:line or URL evidence). Never edits structured outputs. Proof gates still apply - freehand never skips proof. Declare with one _requests.md row (lane = hunt-auth-bitterpill) so completion-gate routes to this artifact contract instead of the checklist ledger.
Depth walk (mandatory)
Walk EVERY applicable row of the payload arsenal page cited above.
Record each row in $RUN/coverage-depth.md as a table
| row | state | evidence | where state is probed, blocked, or
N/A, and evidence is a probe-pair path or a Deadends.md line. A bare
probed with no evidence reference fails the completion gate
(NEEDS-REVIEW). N/A rows cite why (surface shape forbids it).
Blocked implies research: before any Deadend is claimable on a blocked
row, (a) walk the arsenal page's bypass-ladder rows for that control
class, and (b) run one wiki query AND one mcp__wigolo__search for the
specific tech-plus-control bypass. Results, or a genuine null, land in
coverage-depth.md. "No research tried" is not a claimable state.
CSRF / CORS / MFA bypass / WebAuthn (orphan classes fold into this skill)
- CSRF: on every state-changing endpoint, test token enforcement three
ways (token removed, stale token, token borrowed from the other
account - two-account rule). Confirmation requires the action to land
cross-origin, not just a 200. Arsenal rows:
wiki/payloads/csrf.md. - CORS: reflect-origin, null-origin (
Origin: null), subdomain wildcard, header/credential combinations. The finding is a reflected attacker origin WITHAccess-Control-Allow-Credentials: trueon a credentialed endpoint. Arsenal rows:wiki/payloads/cors.md. - MFA bypass: response-state tampering (client-trusted JSON state),
OTP window/rate shape, reset flows that skip the second factor,
trust-device and remember-me abuse. Two-account rule mandatory;
never lock a real account. Arsenal rows:
wiki/payloads/mfa-bypass.md. - WebAuthn/passkey: ceremony confusion (registration vs assertion),
counter-reset handling (clone detection ignored), origin pinning on
the server-side verify step. Arsenal rows:
wiki/payloads/webauthn.md.
Exit artifact + handoff
ONE exit artifact set: $RUN/candidates.jsonl (machine) +
candidates.md (human) + $ENG_DIR/hunt-auth-.md (pointer with
AUTH-HUNT-DONE + counts). The consumer (triage) finds at $RUN:
raw/auth-map.md, raw/legacy-matrix.md, probes/.jsonl, probes/raw/,
candidates.{jsonl,md}. Findings leave ONLY through G1 (triage).
Distill confirmed GENERIC patterns: python3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/web/authentication-attacks.md.
Stop conditions
Terminal states complete (probed | N/A with reason | deadend row written), nothing written into skill dirs (skills/exploit/hunt/ hunt-auth/ stays untouched), no unchecked boxes above REVIEW. hunt-core stop conditions fire unchanged.
Attack surface
APPROACH: Probe the legacy-protocol endpoints (xmlrpc/EWS/_vti_bin/etc.) first - a second door to the same credential store with no rate limit/MFA; then reset-flow poisoning (host-header, Referer token), session/MFA/JWT manipulation, and read the form (username-only = instant ATO).
WebSocket (folds into this skill): a ws:///wss:// endpoint is an auth surface - check the handshake Origin echo (CSWSH: a browser page on an evil origin connects WITH the victim's cookies when the server reflects any Origin), whether auth lives only in the handshake URL/token (replay it from a clean client), and whether session state is shared between the socket and HTTP requests. Confirm hijacking with a live second session (response delta), not a handshake 101. Techniques: [[websocket-attacks]].
AVOID: A 200 on the login/reset form, a friendlier error, a reset email merely received, or an edited JWT the server did not reject is NOT confirmation - you must obtain an authenticated session as a DIFFERENT user in a clean profile.