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.

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
Copyright bensmithett ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

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



  <iframe src=""></iframe>
<iframe src=""></iframe>
<iframe src=""></iframe>
<a href="#" onclick="alert('pwnd')"></a>



/*Downloaded from */
a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,0,0,0.1);