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

# Простой обход 2FA

### Простой обход 2FA

В этой лабораторной работе используется двухфакторная аутентификация, которую можно обойти. У нас уже есть действительные имя пользователя и пароль, но у нас нет доступа к коду 2FA, отправленному жертве. Цель — получить доступ к странице аккаунта Карлоса.

```bash
Ваши учетные данные: wiener:peter
Учетные данные жертвы carlos:montoya
```

<figure><img src="/files/9429f643cbe8b2f5e5aab41731f66b8e091b994a" alt=""><figcaption></figcaption></figure>

После входа под учетными данными Карлоса сервер отправляет код 2FA по электронной почте. При вводе этого 4-значного кода запрос отправляется в **POST** в конечную точку **/login2**.

<figure><img src="/files/4e53d29eaccb46b5b520e43c7bdab4d9fefc16a6" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4a01fec89a70c781668cdf18b441118156c4bffd" alt="" width="499"><figcaption></figcaption></figure>

Однако этот шаг можно полностью обойти. Вместо отправки кода 2FA просто запросите доступ напрямую к **/my-account**. Сервер некорректно проверяет состояние подтверждения 2FA и разрешает доступ даже без кода.

<figure><img src="/files/828229b7bc46d487857ac55359fbe72199e3508f" 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/ru/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.
