> 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

Notes sur le contournement simple de la 2FA pour les laboratoires de la PortSwigger Web Security Academy, incluant le workflow d’exploitation, les tests de payloads, la validation dans Burp Suite et le contexte de remédiation.

### Contournement simple de la 2FA

Ce laboratoire utilise une authentification à deux facteurs qui peut être contournée. Nous disposons déjà d’un nom d’utilisateur et d’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="https://3840167291-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>

Après s’être connecté 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="https://3840167291-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://3840167291-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>

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="https://3840167291-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/fr/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.
