Daemon Of Hacking
  • WELCOME!
    • 👋/home/usr/KruKnight
  • METHODOLOGIES & RESOURCES
    • Passwords & Attacks
    • Post Exploitation
      • 👀Situational Awareness
      • 🖥️Privilege Escalation
        • Linux Privilege Escalation
        • Windows Privilege Escalation
  • Writeups
    • CyCtf 2024
      • Vending Machine
      • Aerospace
      • OhMyCell
    • Portswigger Labs
      • Authentication
        • Username enumeration via different responses
        • 2FA simple bypass
        • Password reset broken logic
        • Username enumeration via subtly different responses
        • Username enumeration via response timing
        • Broken Brute-Force Protection, IP Block
        • Username enumeration via account lock
        • 2FA broken logic
        • Brute-forcing a stay-logged-in cookie
        • Offline password cracking
        • Password reset poisoning via middleware
        • Password brute-force via password change
        • Broken brute-force protection, multiple credentials per request
      • Os Command Injection
        • OS command injection, simple case
        • Blind OS command injection with time delays
        • Blind OS command injection with output redirection
        • Blind OS command injection with out-of-band interaction
        • Blind OS command injection with out-of-band data exfiltration
      • Cross-Origin Resource Sharing (CORS)
        • CORS vulnerability with basic origin reflection
        • CORS vulnerability with trusted null origin
        • CORS vulnerability with trusted insecure protocols
      • Server-side template injection
        • Basic server-side template injection
        • Basic server-side template injection (code context)
      • Server-Side Request Forgery (SSRF)
        • Basic SSRF against the local server
        • Basic SSRF against another back-end
        • Blind SSRF with out-of-band detection
        • SSRF with blacklist-based input filter
        • SSRF with filter bypass via open redirection vulnerability
      • Path Traversal
  • 🟩HTB Writeups
    • Heal
Powered by GitBook
On this page
  • Lab description
  • Walkthrough
  • Step 1: Login to your account
  • Step 2: Bypass the 2FA mechanism
  • Step 3: Exploit the 2FA bypass vulnerability
  • Step 4: Verify the exploit

Was this helpful?

  1. Writeups
  2. Portswigger Labs
  3. Authentication

2FA simple bypass

PreviousUsername enumeration via different responsesNextPassword reset broken logic

Last updated 6 months ago

Was this helpful?

Lab description

Walkthrough

Step 1: Login to your account

Use the given credentials wiener:peter to log in. Once you enter the correct username and password, the application redirects you to a page asking for a 2FA code.

Step 2: Bypass the 2FA mechanism

After entering the correct One-Time Password (OTP) for the wiener account, you gain full access to your account. However, our goal is to bypass the 2FA for the victim's account (carlos:montoya).

Step 3: Exploit the 2FA bypass vulnerability

Log in using the victim's credentials carlos:montoya. Instead of entering the OTP, manually navigate to the /my-account page by modifying the URL in your browser. This will bypass the 2FA mechanism.

For example:

  • Replace the 2FA page URL (/login2) with /my-account.

Step 4: Verify the exploit

After modifying the URL, you are successfully logged into Carlos's account without needing to provide the OTP. This confirms the 2FA bypass vulnerability.