> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/web/authentication/simple-2fa-bypass.md).

# Elusión sencilla de 2FA

### Evasión simple de 2FA

Este laboratorio usa autenticación de dos factores que puede ser eludida. Ya tenemos un nombre de usuario y una contraseña válidos, pero no tenemos acceso al código 2FA enviado a la víctima. El objetivo es acceder a la página de la cuenta de Carlos.

```bash
Tus credenciales: wiener:peter
Credenciales de la víctima: carlos:montoya
```

<figure><img src="/files/527d2364fe10b3acee85c382b17e195057a92ae0" alt=""><figcaption></figcaption></figure>

Después de iniciar sesión con las credenciales de Carlos, el servidor envía un código 2FA por correo electrónico. Al introducir este código de 4 dígitos, la solicitud se envía en **POST** al endpoint **/login2**.

<figure><img src="/files/8c5a399bb6b15966744a76bcb4ec91f330516387" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9c982ea14fb61095577227341df78aed554dc93f" alt="" width="499"><figcaption></figcaption></figure>

Sin embargo, es posible omitir completamente este paso. En lugar de enviar el código 2FA, simplemente solicita acceso directamente a **/my-account**. El servidor no comprueba correctamente el estado de validación de 2FA y permite el acceso a pesar de la falta de código.

<figure><img src="/files/160c1e53181202df3bacf397e04c8dd2a1f2e0a1" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/web/authentication/simple-2fa-bypass.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
