Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The clickjacking attack #374

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 76 additions & 76 deletions 3-frames-and-windows/06-clickjacking/article.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<body style="margin:10px;padding:10px">

<input type="button" onclick="alert('Like pressed on facebook.html!')" value="I LIKE IT !">
<input type="button" onclick="alert('¡"Me gusta" presionado en facebook.html!')" value="ME GUSTA !">
homero304 marked this conversation as resolved.
Show resolved Hide resolved

</body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
}
</style>

<div>Click to get rich now:</div>
<div>Haga clic para hacerse rico ahora:</div>

<!-- The url from the victim site -->
<iframe src="facebook.html"></iframe>

<button>Click here!</button>
<button>¡Haga clic aquí!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...Y eres genial (en realidad soy un pirata informático genial)!</div>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<body style="margin:10px;padding:10px">

<input type="button" onclick="alert('Like pressed on facebook.html!')" value="I LIKE IT !">
<input type="button" onclick="alert('¡"Me gusta" presionado en facebook.html!')" value="ME GUSTA !">
homero304 marked this conversation as resolved.
Show resolved Hide resolved

</body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
}
</style>

<div>Click to get rich now:</div>
<div>Haga clic para hacerse rico ahora:</div>

<!-- The url from the victim site -->
<iframe src="facebook.html"></iframe>

<button>Click here!</button>
<button>¡Haga clic aquí!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...Y eres genial (en realidad soy un pirata informático genial)!</div>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<body>

<div id="protector">
<a href="/" target="_blank">Go to the site</a>
<a href="/" target="_blank">Ir al sitio</a>
</div>

<script>
Expand All @@ -31,11 +31,11 @@

</script>

This text is always visible.
Este texto siempre está visible.

But if the page was open inside a document from another domain, the div over it would prevent any actions.
Pero si la página estuviera abierta dentro de un documento de otro dominio, el div sobre ella evitaría cualquier acción.

<button onclick="alert(1)">Click wouldn't work in that case</button>
<button onclick="alert(1)">El clic no funcionaría en ese caso</button>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<body>

<div>Changes top.location to javascript.info</div>
<div>Cambia top.location a javascript.info</div>

<script>
top.location = 'https://javascript.info';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

window.onbeforeunload = function() {
window.onbeforeunload = null;
return "Want to leave without learning all the secrets (he-he)?";
return "¿Quieres irte sin conocer todos los secretos (je-je)?";
};

document.body.insertAdjacentHTML('beforeend', '<iframe src="iframe.html">');
Expand All @@ -31,11 +31,11 @@

<body>

<p>After a click on the button the visitor gets a "strange" question about whether they want to leave.</p>
<p>Después de hacer clic en el botón, el visitante recibe una pregunta "extraña" sobre si quiere irse.</p>

<p>Probably they would respond "No", and the iframe protection is hacked.</p>
<p>Probablemente responderían "No", y la protección de iframe está pirateada.</p>

<button onclick="attack()">Add a "protected" iframe</button>
<button onclick="attack()">Agregar un iframe "protegido"</button>

</body>
</html>