From 96a32849754c063ab1cf251487c79d273bfb0179 Mon Sep 17 00:00:00 2001 From: Bracaval Elias Date: Sun, 31 Oct 2021 19:14:32 +0100 Subject: [PATCH] Update article.md --- .../06-clickjacking/article.md | 142 +++++++++--------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 1daa87dd0..cea0e54dc 100644 --- a/3-frames-and-windows/06-clickjacking/article.md +++ b/3-frames-and-windows/06-clickjacking/article.md @@ -1,33 +1,33 @@ -# The clickjacking attack +# L'attaque par clickjacking -The "clickjacking" attack allows an evil page to click on a "victim site" *on behalf of the visitor*. +L'attaque par "clickjacking" permet à une page malveillante de cliquer sur un "site victime" *au nom du visiteur*. -Many sites were hacked this way, including Twitter, Facebook, Paypal and other sites. They have all been fixed, of course. +De nombreux sites ont été piratés de cette manière, notamment Twitter, Facebook, Paypal et d'autres sites. Ils ont tous été réparés, bien sûr. -## The idea +## L'idée -The idea is very simple. +L'idée est très simple. -Here's how clickjacking was done with Facebook: +Voici comment le clickjacking a été fait avec Facebook: -1. A visitor is lured to the evil page. It doesn't matter how. -2. The page has a harmless-looking link on it (like "get rich now" or "click here, very funny"). -3. Over that link the evil page positions a transparent ` @@ -45,35 +45,35 @@ iframe { /* iframe from the victim site */
...And you're cool (I'm a cool hacker actually)!
``` -The full demo of the attack: +La démo complète de l'attaque: [codetabs src="clickjacking-visible" height=160] -Here we have a half-transparent ` ``` -There are other ways to work around that simple protection too. +Il existe également d'autres moyens de contourner cette simple protection. ## X-Frame-Options -The server-side header `X-Frame-Options` can permit or forbid displaying the page inside a frame. +L'en-tête `X-Frame-Options` côté serveur peut autoriser ou interdire l'affichage de la page dans un iframe. -It must be sent exactly as HTTP-header: the browser will ignore it if found in HTML `` tag. So, `` won't do anything. +Il doit être envoyé exactement comme un en-tête HTTP : le navigateur l'ignorera s'il se trouve dans la balise HTML ``. Ainsi, `` ne fera rien. -The header may have 3 values: +L'en-tête peut avoir 3 valeurs: `DENY` -: Never ever show the page inside a frame. +: Ne jamais afficher la page à l'intérieur d'un iframe. `SAMEORIGIN` -: Allow inside a frame if the parent document comes from the same origin. +: Autoriser à l'intérieur d'un iframe si le document parent a la même origine.. `ALLOW-FROM domain` -: Allow inside a frame if the parent document is from the given domain. +: Autoriser à l'intérieur d'un iframe si le document parent appartient au domaine donné.. -For instance, Twitter uses `X-Frame-Options: SAMEORIGIN`. +Par exemple, Twitter utilise `X-Frame-Options: SAMEORIGIN`. ````online -Here's the result: +Voici le résultat: ```html @@ -149,16 +149,16 @@ Here's the result: -Depending on your browser, the `iframe` above is either empty or alerting you that the browser won't permit that page to be navigating in this way. +Selon votre navigateur, le `iframe` ci-dessus est soit vide, soit vous avertit que le navigateur ne permet pas de naviguer sur cette page de cette manière. ```` -## Showing with disabled functionality +## Affichage de la fonctionnalité désactivée -The `X-Frame-Options` header has a side-effect. Other sites won't be able to show our page in a frame, even if they have good reasons to do so. +L'en-tête `X-Frame-Options` a un effet secondaire. Les autres sites ne pourront pas afficher notre page dans un iframe, même s'ils ont de bonnes raisons de le faire. -So there are other solutions... For instance, we can "cover" the page with a `
` with styles `height: 100%; width: 100%;`, so that it will intercept all clicks. That `
` is to be removed if `window == top` or if we figure out that we don't need the protection. +Il existe donc d'autres solutions... Par exemple, on peut "couvrir" la page avec une `
` avec les styles `height : 100% ; width : 100%;`, pour qu'elle intercepte tous les clics. Cette `
` doit être retirée si `window == top` ou si l'on s'aperçoit que l'on n'a pas besoin de cette protection. -Something like this: +Quelque chose comme ça: ```html