diff --git a/3-frames-and-windows/06-clickjacking/article.md b/3-frames-and-windows/06-clickjacking/article.md index 1daa87dd0..a60293134 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'attacco clickjacking -The "clickjacking" attack allows an evil page to click on a "victim site" *on behalf of the visitor*. +L'attacco "clickjacking" consente ad una pagina maligna di cliccare su un "sito vittima" *per conto dell'utente*. -Many sites were hacked this way, including Twitter, Facebook, Paypal and other sites. They have all been fixed, of course. +Molti siti hanno subito attacchi di questo tipo, inclusi Twitter, Facebook, Paypal e molti altri. Ovviamente, il problema in questi siti è stato risolto. -## The idea +## L'idea -The idea is very simple. +L'idea è piuttosto semplice. -Here's how clickjacking was done with Facebook: +Il clickjacking nel caso di Facebook funzionava in questo modo: -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 dimostrazione completa di come funziona l'attacco: [codetabs src="clickjacking-visible" height=160] -Here we have a half-transparent ` ``` -There are other ways to work around that simple protection too. +Ci sono altri modi per aggirare questa protezione. ## X-Frame-Options -The server-side header `X-Frame-Options` can permit or forbid displaying the page inside a frame. +L'header server-side `X-Frame-Options` consente di definire se permettere o meno l'apertura di una pagina all'interno di 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. +Deve essere inviato come HTTP-header: il browser lo ignorerà se provate ad inserirlo tarmite il tag ``. Quindi, `` non avrà alcun effetto. -The header may have 3 values: +L'header può assumere 3 valori: `DENY` -: Never ever show the page inside a frame. +: Non mostrare mai la pagina dentro un iframe. `SAMEORIGIN` -: Allow inside a frame if the parent document comes from the same origin. +: Consenti di mostrare la pagina dentro un iframe, se appartiene alla stessa origine. `ALLOW-FROM domain` -: Allow inside a frame if the parent document is from the given domain. +: Consenti di mostrare la pagina dentro un iframe se il documento genitore appartiene al `domain` fornito. -For instance, Twitter uses `X-Frame-Options: SAMEORIGIN`. +Ad esempio, Twitter utilizza `X-Frame-Options: SAMEORIGIN`. ````online -Here's the result: +Qui vediamo il risultato: ```html ``` - + -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. +In base al browser che state utilizzando, l'`iframe` definito sopra potrebbe o essere vuoto oppure avvertirvi che il browser non permette alla pagina questo tipo di navigazione. ```` -## Showing with disabled functionality +## Visualizzazione con funzionalità limitate -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'utilizzo dell'header `X-Frame-Options` causa un side-effect. Le altre pagine non saranno in grado di mostrare la nostra pagina in un iframe, anche se queste non avessero scopi malevoli. -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. +Quindi ci sono altre soluzioni... Ad esempio, possiamo "racchiudere" la pagina con un `
` e impostargli come stile `height: 100%; width: 100%;`, in questo modo intercetterà tutti i click. Andremo poi a rimuovere quel `
` nel caso in cui `window == top` o se ci rendiamo conto di non avere bisogno di questa protezione. -Something like this: +In questo modo: ```html