> 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).

# Bypass simple de 2FA

Notas sobre Bypass simple de 2FA para los laboratorios de PortSwigger Web Security Academy, incluido el flujo de explotación, pruebas de payload, validación en Burp Suite y contexto de mitigación.

### Bypass simple de 2FA

Este laboratorio utiliza 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="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bdc1aa5af305ccb244a863d2e3d49d6361fb8291%2F%7B0BE8A5AC-9311-40A2-A0D5-1AC4BF391230%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Después de conectarse 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="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9cea1846d26674ea0ce830bdb8cd84eb6b1039f2%2F%7B6DA8DC74-3130-4AB7-98CE-BA6C0AA0A5C4%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8bb66a79dacacabd4c561c64ff6c87a94b4e34f2%2F%7BE0B7211B-BDC9-45EF-BFFC-D15F6E9BFF90%7D.png?alt=media" alt="" width="499"><figcaption></figcaption></figure>

Sin embargo, es posible omitir por completo este paso. En lugar de enviar el código 2FA, simplemente solicite 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 del código.

<figure><img src="https://754079710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-61291969d8a04913a7e5fc71615822c891c912f8%2F%7BBBE6644C-6869-4046-9B20-37F42B4188C1%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
