2023-07-30 21:28:42 +00:00
# 2FA/OTP Bypass
2022-04-28 16:01:33 +00:00
< details >
2024-02-10 17:52:19 +00:00
< summary > < strong > htARTE (HackTricks AWS Red Team Expert)< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > qa'vIn HackTricks AWS hacking< / strong > < / a > < strong > !< / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-02-10 17:52:19 +00:00
HackTricks yIlo'be'chugh:
2023-12-31 01:24:39 +00:00
2024-02-10 17:52:19 +00:00
* **HackTricks advertisement** vItlhutlhlaHbe'chugh **company** vItlhutlhlaH **SUBSCRIPTION PLANS** [**SUBSCRIPTION PLANS** ](https://github.com/sponsors/carlospolop ) **ghItlhutlh** .
* [**official PEASS & HackTricks swag** ](https://peass.creator-spring.com ) **ghItlhutlh** .
* [**The PEASS Family** ](https://opensea.io/collection/the-peass-family ) **ghItlhutlh** [**NFTs** ](https://opensea.io/collection/the-peass-family ) **ghItlhutlh** .
* **Join the** 💬 [**Discord group** ](https://discord.gg/hRep4RUj7f ) **ghItlhutlh** [**telegram group** ](https://t.me/peass ) **ghItlhutlh** **follow** **Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/hacktricks_live )**.**
* **Share your hacking tricks by submitting PRs to the** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) **ghItlhutlh** [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) **github repos** **ghItlhutlh** .
2022-04-28 16:01:33 +00:00
< / details >
2024-02-06 03:10:38 +00:00
## **Enhanced Two-Factor Authentication Bypass Techniques**
2022-04-28 16:01:33 +00:00
2024-02-06 03:10:38 +00:00
### **Direct Endpoint Access**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA vItlhutlhlaHbe'chugh, path vItlhutlhlaHbe'chugh endpoint vItlhutlhlaH. vItlhutlhlaHbe'chugh, **Referrer header** vItlhutlhlaHbe'chugh 2FA verification page navigation mimic.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Token Reuse**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA vItlhutlhlaHbe'chugh, authentication token vItlhutlhlaHbe'chugh account reutilizing vItlhutlhlaH.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Utilization of Unused Tokens**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA vItlhutlhlaHbe'chugh, token vItlhutlhlaHbe'chugh account extraction vItlhutlhlaHbe'chugh 2FA bypass vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Exposure of Token**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
Token vItlhutlhlaHbe'chugh web application response vItlhutlhlaHbe'chugh investigate vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Verification Link Exploitation**
2023-07-30 21:28:42 +00:00
2024-02-10 17:52:19 +00:00
**email verification link sent upon account creation** vItlhutlhlaHbe'chugh profile access without 2FA vItlhutlhlaHbe'chugh, [post ](https://srahulceh.medium.com/behind-the-scenes-of-a-security-bug-the-perils-of-2fa-cookie-generation-496d9519771b ) vItlhutlhlaHbe'chugh.
2023-07-30 21:28:42 +00:00
2024-02-06 03:10:38 +00:00
### **Session Manipulation**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
user's account vItlhutlhlaHbe'chugh victim's account vItlhutlhlaHbe'chugh session vItlhutlhlaHbe'chugh initiate vItlhutlhlaHbe'chugh, user's account 2FA vItlhutlhlaHbe'chugh complete vItlhutlhlaHbe'chugh, victim's account flow vItlhutlhlaHbe'chugh next step vItlhutlhlaHbe'chugh access vItlhutlhlaHbe'chugh, backend session management limitations vItlhutlhlaHbe'chugh exploit vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Password Reset Mechanism**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
password reset function vItlhutlhlaHbe'chugh investigate vItlhutlhlaHbe'chugh, user vItlhutlhlaHbe'chugh application post-reset login vItlhutlhlaHbe'chugh, multiple resets vItlhutlhlaHbe'chugh same link vItlhutlhlaHbe'chugh 2FA vItlhutlhlaHbe'chugh bypass vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **OAuth Platform Compromise**
2023-10-05 10:00:26 +00:00
2024-02-10 17:52:19 +00:00
user's account vItlhutlhlaHbe'chugh trusted **OAuth** platform (e.g., Google, Facebook) vItlhutlhlaHbe'chugh compromise vItlhutlhlaHbe'chugh, 2FA vItlhutlhlaHbe'chugh bypass vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Brute Force Attacks**
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Rate Limit Absence**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
code attempts vItlhutlhlaHbe'chugh limit vItlhutlhlaHbe'chugh brute force attacks vItlhutlhlaHbe'chugh, silent rate limiting vItlhutlhlaHbe'chugh consider vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Slow Brute Force**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
flow rate limits vItlhutlhlaHbe'chugh slow brute force attack vItlhutlhlaHbe'chugh viable vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Code Resend Limit Reset**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
code vItlhutlhlaHbe'chugh resend vItlhutlhlaHbe'chugh rate limit reset vItlhutlhlaHbe'chugh, continued brute force attempts vItlhutlhlaHbe'chugh facilitate vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Client-Side Rate Limit Circumvention**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
document vItlhutlhlaHbe'chugh client-side rate limiting vItlhutlhlaHbe'chugh bypass techniques vItlhutlhlaHbe'chugh detail vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Internal Actions Lack Rate Limit**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
rate limits vItlhutlhlaHbe'chugh login attempts vItlhutlhlaHbe'chugh internal account actions vItlhutlhlaHbe'chugh protect vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **SMS Code Resend Costs**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
codes vItlhutlhlaHbe'chugh SMS vItlhutlhlaHbe'chugh resend vItlhutlhlaHbe'chugh, company vItlhutlhlaHbe'chugh cost vItlhutlhlaHbe'chugh, 2FA vItlhutlhlaHbe'chugh bypass vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Infinite OTP Regeneration**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
simple codes vItlhutlhlaHbe'chugh endless OTP generation vItlhutlhlaHbe'chugh, small set vItlhutlhlaHbe'chugh retry vItlhutlhlaHbe'chugh brute force vItlhutlhlaHbe'chugh.
2021-01-07 12:13:26 +00:00
2024-02-06 03:10:38 +00:00
### **Race Condition Exploitation**
2021-01-07 12:13:26 +00:00
2024-02-10 17:52:19 +00:00
2FA bypass vItlhutlhlaHbe'chugh race conditions vItlhutlhlaHbe'chugh exploit vItlhutlhlaHbe'chugh.
2023-08-16 04:32:29 +00:00
2024-02-06 03:10:38 +00:00
### **CSRF/Clickjacking Vulnerabilities**
2023-08-16 04:32:29 +00:00
2024-02-10 17:52:19 +00:00
CSRF vItlhutlhlaHbe'chugh Clickjacking vulnerabilities vItlhutlhlaHbe'chugh explore vItlhutlhlaHbe'chugh 2FA vItlhutlhlaHbe'chugh disable vItlhutlhlaHbe'chugh viable strategy vItlhutlhlaHbe'chugh.
2023-08-16 04:32:29 +00:00
2024-02-06 03:10:38 +00:00
### **"Remember Me" Feature Exploits**
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Predictable Cookie Values**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
"remember me" cookie value vItlhutlhlaHbe'chugh guess vItlhutlhlaHbe'chugh bypass restrictions vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **IP Address Impersonation**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
victim's IP address vItlhutlhlaHbe'chugh impersonate vItlhutlhlaHbe'chugh **X-Forwarded-For** header vItlhutlhlaHbe'chugh bypass restrictions vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Utilizing Older Versions**
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **Subdomains**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
subdomains vItlhutlhlaHbe'chugh test vItlhutlhlaHbe'chugh outdated versions vItlhutlhlaHbe'chugh 2FA support vItlhutlhlaHbe'chugh vulnerable 2FA implementations vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
#### **API Endpoints**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
/v\*/ directory paths vItlhutlhlaHbe'chugh older API versions vItlhutlhlaHbe'chugh, 2FA bypass methods vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Handling of Previous Sessions**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA activation vItlhutlhlaHbe'chugh existing sessions vItlhutlhlaHbe'chugh terminate vItlhutlhlaHbe'chugh, unauthorized access vItlhutlhlaHbe'chugh compromised sessions vItlhutlhlaHbe'chugh secure vItlhutlhlaHbe'chugh accounts vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Access Control Flaws with Backup Codes**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA activation vItlhutlhlaHbe'chugh immediate generation vItlhutlhlaHbe'chugh potential unauthorized retrieval vItlhutlhlaHbe'chugh backup codes vItlhutlhlaHbe'chugh, CORS misconfigurations/XSS vulnerabilities vItlhutlhlaHbe'chugh risk vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Information Disclosure on 2FA Page**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
2FA verification page vItlhutlhlaHbe'chugh sensitive information disclosure (e.g., phone number) vItlhutlhlaHbe'chugh concern vItlhutlhlaHbe'chugh.
2020-07-15 15:43:14 +00:00
2024-02-06 03:10:38 +00:00
### **Password Reset Disabling 2FA**
2020-07-15 15:43:14 +00:00
2024-02-10 17:52:19 +00:00
account creation v