2FA Bypass Techniques

apex
3 min readFeb 8, 2022

--

2FA Bypass Techniques

Hello lads, it’s me again. Let’s discuss different techniques about bypassing 2FA.

1. 2FA Code Leakage in Response:

  1. At 2FA Code Triggering request, such as Send OTP functionality, capture the request.

2. See the response of this request and analyze if the 2FA Code is leaked.

2. JS File Analysis:

While triggering the 2FA Code Request, Analyze all the JS Files that are referred in the response to see if any JS file contains information that can help bypass 2FA code.

3. Lack of brute-Force Protection:

This involves all sorts of issues which comes under security misconfigurations such as lack of rate limit, no brute-force protection, etc.

  1. Request 2FA code and capture the request.
  2. Repeat this request for 100–200 times and if there is no limitation set, that’s a rate limit issue.
  3. At 2FA Code Verification page, try to brute-force for valid 2FA and see if there is any success.
  4. You can also try to initiate, requesting OTP’s at one side and brute-forcing at another side. At some point, the OTP will coincide and may give you a quick result.

4. Password Reset / Email Change — 2FA Disable:

  1. Assuming that you are able to perform sophisticated phishing campaigns, force the end user to do change the password.
  2. 2FA is disabled after the email is changed or the password is reset. This could be an issue for some organizations. However, it depends on case by case basis.

5. Missing 2FA Code Integrity Validation:

  1. Request a 2FA code from the attacker’s account.
  2. Use this valid 2FA code in the victim 2FA Request and see if it bypasses the 2FA protection.

6. Direct Request:

Directly navigate to the page which comes after 2FA or any other authenticated page of the application and see if this bypasses the 2FA restrictions.

7. 2FA Refer Check Bypass:

  1. Directly navigate to the page which comes after 2FA or any other authenticated page of the application.
  2. If there is no success, change the refer header to the 2FA page URL. This may fool application to pretend as if the request came after satisfying 2FA condition.

8. Backup Code Abuse:

Apply same techniques used on 2FA such as Response/Status Code Manipulation, brute-force, etc. to bypass backup codes and disable/reset 2FA.

9. Enabling 2FA Doesn’t Expire Previous Session:

  1. Login to the application in two different browsers and enable 2FA from 1st session.
  2. Use 2nd session and if it is not expired, it could be an issue if there is an insufficient session expiration issue. In this scenario, if an attacker hijacks an active session before 2FA, it is possible to carry out all functions without a need for 2FA.

10. Clickjacking on 2FA Disable Feature:

  1. Try to iframe the page where the application allows a user to disable 2FA.
  2. If iframe attack vector is successful, try to perform a social engineering attack to manipulate the victim to fall in to your trap.

11. Response Manipulation:

  1. Check response of the 2FA Request.
  2. If you observe “Success”:false, change this to “Success”:true and see if it bypasses the 2FA.
  3. You can also use Burp “Match & Replace” rules for this.

12. Status Code Manipulation:

  1. If the Response Status Code is 4xx like 401, 402, etc.
  2. Change the response Status Code to “200 OK” and see if it bypasses the 2FA.

13. 2FA Code Reusability:

  1. Request a 2FA code and use it.
  2. Now, re-use the same 2FA code in another session and if it authenticated successfully, that’s a potential issue.
  3. Also, try requesting multiple 2FA codes, and see if previously requested codes expire or not when a new code is requested.
  4. Also, try to re-use the previously used code after long time duration i.e 1 day or more. If it is successful, that is an issue since 1 day is more than enough for a sophisticated hacker to either brute-force or crack a 6-digit 2FA Code.

14. CSRF on 2FA Disable Feature:

  1. Navigate to 2FA Page and click on “Disable 2FA” and capture this request with Burp Suite & generate a CSRF PoC.
  2. Send this PoC to the victim, and check if CSRF happens successfully and remove the 2FA from the victim account.
  3. Also, check if there is any authentication confirmation sucha s password or 2FA code required before disabling 2FA.

--

--

apex

I try to analyze ransomware attacks | Static Code Analysis | Privacy & Security Updates | Pen Testing | Bug Bounty