2FA Bypass Techniques
Hello lads, it’s me again. Let’s discuss different techniques about bypassing 2FA.
1. 2FA Code Leakage in Response:
- 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.
- Request 2FA code and capture the request.
- Repeat this request for 100–200 times and if there is no limitation set, that’s a rate limit issue.
- At 2FA Code Verification page, try to brute-force for valid 2FA and see if there is any success.
- 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:
- Assuming that you are able to perform sophisticated phishing campaigns, force the end user to do change the password.
- 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:
- Request a 2FA code from the attacker’s account.
- 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:
- Directly navigate to the page which comes after 2FA or any other authenticated page of the application.
- 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:
- Login to the application in two different browsers and enable 2FA from 1st session.
- 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:
- Try to iframe the page where the application allows a user to disable 2FA.
- 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:
- Check response of the 2FA Request.
- If you observe “Success”:false, change this to “Success”:true and see if it bypasses the 2FA.
- You can also use Burp “Match & Replace” rules for this.
12. Status Code Manipulation:
- If the Response Status Code is 4xx like 401, 402, etc.
- Change the response Status Code to “200 OK” and see if it bypasses the 2FA.
13. 2FA Code Reusability:
- Request a 2FA code and use it.
- Now, re-use the same 2FA code in another session and if it authenticated successfully, that’s a potential issue.
- Also, try requesting multiple 2FA codes, and see if previously requested codes expire or not when a new code is requested.
- 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:
- Navigate to 2FA Page and click on “Disable 2FA” and capture this request with Burp Suite & generate a CSRF PoC.
- Send this PoC to the victim, and check if CSRF happens successfully and remove the 2FA from the victim account.
- Also, check if there is any authentication confirmation sucha s password or 2FA code required before disabling 2FA.