> 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/fr/web/authentication/simple-2fa-bypass.md).

# Contournement simple de la 2FA

### Contournement simple de la 2FA

Ce laboratoire utilise une authentification à deux facteurs qui peut être contournée. Nous avons déjà un nom d'utilisateur et un mot de passe valides, mais nous n'avons pas accès au code 2FA envoyé à la victime. L'objectif est d'accéder à la page du compte de Carlos.

```bash
Vos identifiants : wiener:peter
Identifiants de la victime : carlos:montoya
```

<figure><img src="/files/7e84d9b6ffff1a45945e135d9fcd1a8b66bfb940" alt=""><figcaption></figcaption></figure>

Après la connexion avec les identifiants de Carlos, le serveur envoie un code 2FA par e-mail. En saisissant ce code à 4 chiffres, la requête est envoyée dans **POST** vers le point de terminaison **/login2**.

<figure><img src="/files/2f61fcab32e32cd63a81fb5a3b262978b1b47b07" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7ed3195831bcd668809979a555838fdb852985bb" alt="" width="499"><figcaption></figcaption></figure>

Cependant, il est possible de contourner complètement cette étape. Au lieu de soumettre le code 2FA, demandez simplement l'accès directement à **/my-account**. Le serveur ne vérifie pas correctement l'état de validation de la 2FA et autorise l'accès malgré l'absence de code.

<figure><img src="/files/3f311bf545478b6bd9e8df3561920a0d09f77039" 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/fr/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.
