#@ck3r
  • Welcome
  • Administrator
    • ActiveDirectory
      • Methodology
    • LDAP
    • Kerberos
  • HTB_CTF
    • It's Oops PM
  • 🕸️ Pentesting Web
    • Web Vulnerabilities Methodology
      • Reflecting Techniques - PoCs and Polygloths CheatSheet
        • Web Vulns List
    • 2FA/MFA/OTP Bypass
    • Account Takeover
    • Browser Extension Pentesting Methodology
      • BrowExt - ClickJacking
      • BrowExt - permissions & host_permissions
      • BrowExt - XSS Example
    • Bypass Payment Process
    • Captcha Bypass
    • Cache Poisoning and Cache Deception
      • Cache Poisoning via URL discrepancies
      • Cache Poisoning to DoS
    • Clickjacking
    • Client Side Template Injection (CSTI)
    • Client Side Path Traversal
    • Command Injection
    • Content Security Policy (CSP) Bypass
    • Cookies Hacking
      • Cookie Tossing
    • CORS - Misconfigurations & Bypass
    • CRLF (%0D%0A) Injection
    • CSRF (Cross Site Request Forgery)
  • Dangling Markup - HTML scriptless injection
  • Dependency Confusion
  • Deserialization
    • NodeJS - __proto__ & prototype Pollution
      • Client Side Prototype Pollution
      • Express Prototype Pollution Gadgets
      • Prototype Pollution to RCE
    • CommonsCollection1 Payload - Java Transformers to Rutime exec() and Thread Sleep
    • Java DNS Deserialization, GadgetProbe and Java Deserialization Scanner
    • Basic .Net deserialization (ObjectDataProvider gadget, ExpandedWrapper, and Json.Net)
    • Exploiting __VIEWSTATE without knowing the secrets
    • Python Yaml Deserialization
    • JNDI - Java Naming and Directory Interface & Log4Shell
    • Ruby Class Pollution
  • Page 1
Powered by GitBook
On this page
  • Enhanced Two-Factor Authentication Bypass Techniques
  • References
  1. 🕸️ Pentesting Web

2FA/MFA/OTP Bypass

PreviousWeb Vulns ListNextAccount Takeover

Last updated 3 months ago

To bypass 2FA, access the subsequent endpoint directly, knowing the path is crucial. If unsuccessful, alter the Referrer header to mimic navigation from the 2FA verification page.

Reutilizing previously used tokens for authentication within an account can be effective.

Extracting a token from one's own account to bypass 2FA in another account can be attempted.

Investigate whether the token is disclosed in a response from the web application.

Using the email verification link sent upon account creation can allow profile access without 2FA, as highlighted in a detailed .

Initiating sessions for both the user's and a victim's account, and completing 2FA for the user's account without proceeding, allows an attempt to access the next step in the victim's account flow, exploiting backend session management limitations.

Investigating the password reset function, which logs a user into the application post-reset, for its potential to allow multiple resets using the same link is crucial. Logging in with the newly reset credentials might bypass 2FA.

Compromising a user's account on a trusted OAuth platform (e.g., Google, Facebook) can offer a route to bypass 2FA.

The lack of a limit on the number of code attempts allows for brute force attacks, though potential silent rate limiting should be considered.

A slow brute force attack is viable where flow rate limits exist without an overarching rate limit.

Resending the code resets the rate limit, facilitating continued brute force attempts.

A document details techniques for bypassing client-side rate limiting.

Rate limits may protect login attempts but not internal account actions.

Excessive resending of codes via SMS incurs costs to the company, though it does not bypass 2FA.

Endless OTP generation with simple codes allows brute force by retrying a small set of codes.

Exploiting race conditions for 2FA bypass can be found in a specific document.

Exploring CSRF or Clickjacking vulnerabilities to disable 2FA is a viable strategy.

Guessing the "remember me" cookie value can bypass restrictions.

Impersonating the victim's IP address through the X-Forwarded-For header can bypass restrictions.

Testing subdomains may use outdated versions lacking 2FA support or contain vulnerable 2FA implementations.

Older API versions, indicated by /v*/ directory paths, may be vulnerable to 2FA bypass methods.

Terminating existing sessions upon 2FA activation secures accounts against unauthorized access from compromised sessions.

Immediate generation and potential unauthorized retrieval of backup codes upon 2FA activation, especially with CORS misconfigurations/XSS vulnerabilities, poses a risk.

Sensitive information disclosure (e.g., phone number) on the 2FA verification page is a concern.

A process demonstrating a potential bypass method involves account creation, 2FA activation, password reset, and subsequent login without the 2FA requirement.

Utilizing decoy requests to obfuscate brute force attempts or mislead rate limiting mechanisms adds another layer to bypass strategies. Crafting such requests requires a nuanced understanding of the application's security measures and rate limiting behaviours.

In case the OTP is created based on data the user already has or that is sending previous to create the OTP, it's possible for the user to also generate it and bypass it.

Note that even if a rate limit is in place you should try to see if the response is different when the valid OTP is sent. In , the bug hunter discovered that even if a rate limit is triggered after 20 unsuccessful attempts by responding with 401, if the valid one was sent a 200 response was received.

Enhanced Two-Factor Authentication Bypass Techniques
Direct Endpoint Access
Token Reuse
Utilization of Unused Tokens
Exposure of Token
Verification Link Exploitation
post
Session Manipulation
Password Reset Mechanism
OAuth Platform Compromise
Brute Force Attacks
Rate Limit Absence
this post
Slow Brute Force
Code Resend Limit Reset
Client-Side Rate Limit Circumvention
Internal Actions Lack Rate Limit
SMS Code Resend Costs
Infinite OTP Regeneration
Race Condition Exploitation
CSRF/Clickjacking Vulnerabilities
"Remember Me" Feature Exploits
Predictable Cookie Values
IP Address Impersonation
Utilizing Older Versions
Subdomains
API Endpoints
Handling of Previous Sessions
Access Control Flaws with Backup Codes
Information Disclosure on 2FA Page
Password Reset Disabling 2FA
Decoy Requests
OTP Construction errors
References
https://medium.com/@iSecMax/two-factor-authentication-security-testing-and-possible-bypasses-f65650412b35
https://azwi.medium.com/2-factor-authentication-bypass-3b2bbd907718
https://getpocket.com/read/aM7dap2bTo21bg6fRDAV2c5thng5T48b3f0Pd1geW2u186eafibdXj7aA78Ip116_1d0f6ce59992222b0812b7cab19a4bce