Skip to content

Authentication & Brute-Force

← Back to index · Stage 1 (get an account) · Read the mindset page first.

Why it exists: authentication has many moving parts — login, registration, password reset, "stay logged in," 2FA — and a flaw in any of them grants an account. The exam provides username and password wordlists precisely because these flaws are in scope. The underlying pattern is usually one of: the app tells you which usernames are real (so you can target them), or a flow trusts input it shouldn't.

The one rule: get a valid username before brute-forcing a password — otherwise you're multiplying two unknowns. The app almost always leaks which usernames are real through a response differential; find that first.

Decision tree

flowchart TD
  A["Login / reset / register present"] --> B["Enumerate a valid username"]
  B --> C{"What differential leaks it?"}
  C -->|different message| M["Message-based enum"]
  C -->|different length| L["Length-based enum"]
  C -->|timing| T["Timing-based enum"]
  M --> D{"Then attack what?"}
  L --> D
  T --> D
  D -->|password| BF["Brute-force the known user"]
  D -->|reset flow| PR["Reset abuse"]
  D -->|2FA| TFA["2FA bypass"]
  D -->|stay-logged-in| RM["Forge / brute the cookie"]

1. Enumerate a valid username — why it's step one

Why: brute-forcing passwords is useless without a real username, and usernames are the harder half. The app leaks them because it treats "user doesn't exist" and "wrong password" differently — and you read that difference:

Message  -> "Invalid username" vs "Invalid password" (two different errors = enumeration)
Length   -> a few bytes' difference in the response (read it with Comparer)
Timing   -> a VALID user triggers the slow password-hash check; an invalid one returns instantly
           -> submit a very long password and watch the response time
Intruder the username field with the provided list; grep for the differentiator.

2. Brute-force the password

Intruder: username fixed, password = wordlist; grep the success differentiator (302 redirect, length)

3. Password reset abuse — why it trusts input

Why: reset flows often carry a hidden username/token that the server trusts without re-checking ownership:

POST /forgot-password/refresh
username=administrator&token=        # swap the username, or DROP the token if it's only checked when present
Host-header poisoning (point the reset link at your exploit server — see host header) and a change-password endpoint that skips the current password are the other classics.

4. 2FA bypass & stay-logged-in

2FA — why bypasses work: the second factor is often a separate step the app assumes you'll follow in order:

- skip the step: after step 1, browse directly to the post-login page
- brute the code: often 4 digits with no rate limit (use macros to refresh it)
- swap the account between step 1 and step 2 (2FA bound to the wrong user)
Stay-logged-in cookie — why it's crackable: it often encodes user:hash(password) so the server can re-auth you; decode it, and brute the hash offline or forge it once you crack a password.
echo 'd2llbmVyOjUx...' | base64 -d     # user:md5/sha -> rebuild for administrator

Failure modes

  • No obvious enum differential → try the timing method (a huge password), or diff byte-for-byte with Comparer.
  • Lockout hits fast → rotate X-Forwarded-For, or interleave a known-good login to reset the counter.
  • Reset token tied to session → try the username-swap or token-drop variants.
  • 2FA blocks you → test step-skipping and account-swap before brute-forcing the code.
  • Cookie opaque → base64/hex-decode it; look for a username and a rebuildable hash.