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

# Einfache 2FA-Umgehung

Notizen zur einfachen 2FA-Umgehung für die Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungsablauf, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### Einfache 2FA-Umgehung

Dieses Labor verwendet eine Zwei-Faktor-Authentifizierung, die umgangen werden kann. Wir verfügen bereits über einen gültigen Benutzernamen und ein Passwort, haben aber keinen Zugriff auf den an das Opfer gesendeten 2FA-Code. Das Ziel ist es, auf Carlos' Kontoseite zuzugreifen.

```bash
Ihre Zugangsdaten: wiener:peter
Zugangsdaten des Opfers carlos:montoya
```

<figure><img src="https://2955439919-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>

Nachdem Sie sich mit Carlos’ Zugangsdaten angemeldet haben, sendet der Server per E-Mail einen 2FA-Code. Durch Eingabe dieses 4-stelligen Codes wird die Anfrage gesendet an **POST** den Endpunkt **/login2**.

<figure><img src="https://2955439919-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://2955439919-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>

Allerdings lässt sich dieser Schritt vollständig umgehen. Anstatt den 2FA-Code einzugeben, fordern Sie einfach direkt Zugriff auf **/my-account**. Der Server prüft den 2FA-Validierungsstatus nicht korrekt und gewährt trotz fehlenden Codes Zugriff.

<figure><img src="https://2955439919-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/de/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.
