Skip to content
Account takeover Write-up Beginner

How I Bypassed 2fa And Took Over Accounts With A Simple Brute Force Attack

The login process used a 6-digit OTP sent by email, but the server did not limit the number of verification attempts. An attacker could brute-force the OTP for any victim's email, then use the returned user data to forge a session cookie and take over the account.

Rishant Arora Follow

Published on infosecwriteups.com

I’ve been learning web security for the past few weeks, and during this time, I’ve developed a habit of analyzing how different websites handle their security mechanisms. One day, while booking a concert ticket, something caught my attention.

Rishant Arora, on infosecwriteups.com

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 lacked rate limiting or account lockout, and the session cookie was a predictable, client-side encoded JSON object rather than a server-side secret.

Impact

An attacker could take over any user's account without their credentials or email access, exposing personal data and allowing persistent session hijacking.

What the attacker needed

Victim's email address; ability to intercept HTTP requests; no rate limiting on OTP verification

The fix

The report recommends implementing rate limiting, account lockout after failed attempts, and short OTP expiry; it does not state whether these were applied.

How it was found

  1. Create two accounts, one as attacker and one as victim.
  2. Enter the victim's email on the login page and request an OTP.
  3. Submit a random 6-digit code and intercept the request in Burp Suite.
  4. Send the request to Burp Intruder, select the OTP parameter, and run a brute-force attack.
  5. Look for a response with a different length to identify the correct OTP.
  6. Use the returned user data to replace the currentUserSB cookie in the attacker's browser and refresh to access the victim's 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.

A one-time password (OTP) is a short code sent to your email or phone to prove it's you. If a website lets someone guess that code over and over without slowing them down, the guesser will eventually get it right. Here, the attacker also found that the login cookie was just readable data, so once they had the right code they could pretend to be 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.

More by Rishant Arora

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.