Auto XSS Scanner


SUBMITTED BY: mgalarm

DATE: Aug. 21, 2016, 3:01 p.m.

FORMAT: Text only

SIZE: 3.6 kB

HITS: 520

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

comments powered by Disqus