Skip to content

The clickjacking attack #90

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

Merged
merged 9 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
169 changes: 85 additions & 84 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('facebook.html'de beğen butonuna basıldı!')" value="BEGENDIM">

</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>Zengin olmak için tıkla:</div>

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

<button>Click here!</button>
<button>Buraya tıkla!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...Ve zengin oldun (ve sayfamı beğendin)!</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('facebook.html'de beğen butonuna basıldı!')" value="BEGENDIM!">

</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>Zengin olmak için tıkla:</div>

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

<button>Click here!</button>
<button>Buraya tıkla!</button>

<div>...And you're cool (I'm a cool hacker actually)!</div>
<div>...Ve zengin oldun (ve sayfamı beğendin)!</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">Siteye git</a>
</div>

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

</script>

This text is always visible.
Bu yazı her zaman görünüt halde.

But if the page was open inside a document from another domain, the div over it would prevent any actions.

<button onclick="alert(1)">Click wouldn't work in that case</button>
Ancak eğer sayfa başka bir alan adındaki bir dosyadan gelseydi üzerindeki div herhangi bir aksiyonu engellerdi.
<button onclick="alert(1)">Tıklama burada çalışmazdı</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>top.locationjavascript.info'ya çevirir</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 "Gerçekten tüm kedileri görmeden ayrılmak istiyor musunuz?";
};

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>Bir tıklamadan sonra kullanıcı ayrılmak isteyip istemediğine dair garip bir mesaj alır.</p>

<p>Probably they would respond "No", and the iframe protection is hacked.</p>
<p>Büyük ihtimalle "Hayır" cevabını vereceklerdir, ve iframe koruması çöker.</p>

<button onclick="attack()">Add a "protected" iframe</button>
<button onclick="attack()">"Korumalı" bir iframe ekle</button>

</body>
</html>