How I cracked 2FA with simple factor bruteforce
The OTP verification endpoint for a travel service's login had no rate limiting and no policy to invalidate or rotate the code after repeated failures. An attacker could brute force the four-digit code and obtain a valid login token for any account whose phone number they knew.
Published on medium.com
Today I would like to share how I was able to bypass OTP (One Time Password) login with a simple brute force attack on India’s biggest travel service provider. OTP is treated as an additional measure for security termed as 2FA.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the OTP verification endpoint accepted unlimited attempts and never invalidated the code after repeated failures, so the small keyspace could be exhausted.
Impact
An attacker who knows a victim's mobile number could guess the OTP and take over the account, as the report demonstrates by obtaining a login token.
What the attacker needed
Victim's mobile number known; no rate limit on OTP attempts
How it was found
- Log in with the mobile number and submit a wrong OTP while intercepting the request.
- Send the verify-OTP request to the intruder tool.
- Mark the OTP value as the payload position.
- Set the payload type to numbers covering the desired range and start the attack.
- Watch response lengths for one that differs from the rest.
- Use the resulting login token to access the account.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
After you type your password, many sites send a short numeric code to your phone as a second check. This site let someone guess that code over and over with no limit, so a computer could simply try every possible four-digit number until one worked. That let the attacker finish logging in as the victim.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.