Clickjacking Demo

In this example below you will see how to do a Clickjacking Demo with some HTML / CSS and Javascript

Demoing the benefit of setting the correct X-FRAME headers.

Thumbnail
This awesome code was written by bensmithett, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright bensmithett ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Clickjacking Demo</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <iframe src="https://bensmithett.github.io/dragster"></iframe>
<iframe src="https://github.com"></iframe>
<iframe src="https://google.com"></iframe>
<a href="#" onclick="alert('pwnd')"></a>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/bensmithett/clickjacking-demo-Abcso */
a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,0,0,0.1);
}

Comments