PASSWORD RESET: TOKENS
password-recovery is a functionality that typically relies on a one-time reset token, which is transmitted to the user, for instance, via SMS or E-Mail. reset tokens (in the form of a code or temporary password) are secret data generated by an application when a user requests a password reset. password reset tokens can enable an attacker to reset an account's password without knowledge of the password and can be leveraged as an attack vector to take over a victim's account if implemented incorrectly. when performing this type of attack, there must be an assumption that there are active users who are in the process of resetting their passwords IOT brute-force all active reset tokens. also, a valid webapp user must already be identified IOF this to work.
the following procedure is used to identify weak password reset tokens.
create an account on the target web application
request a password reset token
perform analysis
#example reset token request receive via email
Hello,
We have received a request to reset the password associated with your account. To proceed with resetting your password, please follow the instructions below:
1. Click on the following link to reset your password: Click
2. If the above link doesn't work, copy and paste the following URL into your web browser: http://weak_reset.htb/reset_password.php?token=7351
Please note that this link will expire in 24 hours, so please complete the password reset process as soon as possible. If you did not request a password reset, please disregard this e-mail.
Thank you.
#analysis
* the password reset link contains the reset token in the GET-parameter token
- http://weak_reset.htb/reset_password.php?token=7351
- the token consists of only 4 digit numbers and can be easily brute forced
- each digit position can have at most 10 digits which are 0 through 9
- since there is 4 digit positions, the formula will be
- 10^4 = 10,000 combinations; 0000 - 9999Last updated