Advertisement
H4T3D

Automatic XSS Scanner By H4T3D

Oct 3rd, 2015
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.55 KB | None | 0 0
  1. <?php
  2. ###########################################################
  3. #XSS Cross Site Scripting Automatic Attack Scanner By H4T3D
  4. #image >> http://i.imgur.com/pYJJZFi.png
  5. #Changing Name Wont Make You L33T -_-
  6. ##############################################################
  7.  
  8. header("X-XSS-Protection: 0");
  9. set_time_limit(0);
  10. ?>
  11. <link href='https://fonts.googleapis.com/css?family=Orbitron' rel='stylesheet' type='text/css'>
  12. <style type="text/css">
  13.     body {
  14.         background-color: #f0f0f2;
  15.         margin: 0;
  16.         padding: 0;
  17.         font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  18.        
  19.     }
  20.     h1{    font-family: 'Orbitron', sans-serif; color: #fff;}
  21.     div {
  22.         width: 600px;
  23.         margin: 5em auto;
  24.         padding: 50px;
  25.         //background-color: #fff;
  26.     background-color: black;
  27.         border-radius: 1em;
  28.     word-wrap: break-word;
  29.     }
  30.     a:link, a:visited {
  31.         color: #38488f;
  32.         text-decoration: none;
  33.     }
  34.     @media (max-width: 700px) {
  35.         body {
  36.             background-color: #fff;
  37.         }
  38.         div {
  39.             width: auto;
  40.             margin: 0 auto;
  41.             border-radius: 0;
  42.             padding: 1em;
  43.         }
  44.     }
  45.     </style>
  46. <div>
  47. <center>
  48. <h1>XSS Scanner -H4T3D</h1>
  49. <p>
  50. <form action="" method="POST">
  51. <input type="text" name ="q" placeholder="www.example.com/?q="/>
  52. <input type="submit" name="key" value="SCAN"/>
  53. </form>
  54. </p>
  55. <?php
  56. if(isset($_POST['key']))
  57. {
  58.  
  59. $get=$_POST["q"];
  60. $x=$get;
  61. function scan($x,$payload){
  62.    
  63.         $ch=curl_init();
  64.         curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  65.         curl_setopt($ch,CURLOPT_URL,$x."".urlencode($payload));
  66.         curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
  67.         curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
  68.         curl_setopt($ch,CURLOPT_TIMEOUT,30);
  69.         $data=curl_exec($ch);
  70.     //echo $data;
  71.         if(preg_match('/XSS/',$data)){
  72.          echo"\r\n<font color='#00FF00'>[!] Method POST Url >> <a href='$x?".urlencode($payload)."' target=\"_blank\">$x?".urlencode($payload)."</a></font></br>";
  73.                // echo"\r\n<font color='#00FF00'>[!] Method GET Url >> $x?".urlencode($payload)."</font></br>";
  74.         flush();@ob_flush();
  75.                 return true;
  76.         }else{
  77.                 $ch=curl_init();
  78.                 curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  79.                 curl_setopt($ch,CURLOPT_URL,$x);
  80.                 curl_setopt($ch,CURLOPT_POST,1);
  81.                 curl_setopt($ch,CURLOPT_POSTFIELDS,"".urlencode($payload));
  82.                 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
  83.                 curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
  84.                 curl_setopt($ch,CURLOPT_TIMEOUT,30);
  85.                 $data=curl_exec($ch);
  86.                 if(preg_match('/XSS/',$data)){
  87.                         echo"\r\n<font color='#00FF00'>[!] Method POST Url >> <a href='$x?".urlencode($payload)."'>$x?".urlencode($payload)."</a></font></br>";
  88.             flush();@ob_flush();
  89.                         return true;
  90.                 }else{
  91.             echo"<font color='#f3172d'>\r\n[!] NOT FOUND !!! </font></br>";
  92.             flush();@ob_flush();
  93.                         return false;
  94.                      }
  95.               }
  96.     }
  97.  
  98.  
  99.  
  100. $homepage = file_get_contents('http://pastebin.com/raw.php?i=mJcw4XsU');
  101.         $payloader = explode("\n",$homepage);
  102.     foreach($payloader as $payload) {
  103.     $payload = @trim($payload);
  104. scan($x,$payload);
  105.  
  106. }
  107.  
  108.  
  109.                     }//end of post key
  110.  
  111. ?>
  112. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement