scriptkiddies

Google SQLi Scanner Vulnerability

Jul 16th, 2014
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4.  
  5.  
  6. /*
  7.  
  8. [PHP] Google SQLi Scanner
  9.  
  10. Dorker & Scanner SQLi
  11.  
  12. coder: Dr.1n73ct10n
  13. */
  14.  
  15.  
  16.  
  17. error_reporting(0);
  18.  
  19. set_time_limit(0);
  20.  
  21. echo"
  22.  
  23. (_)   _        _   _________    ___________
  24. | |  | |      | | /---------    ___________
  25. | |  | |      | | || coder by :     | |
  26. | |  | |------| | || Dr.1n73ct10n   | |
  27. | |  | |------| | ||________        | |  
  28. |_|  |_|      |_| \---------        |_|
  29.  
  30.  
  31.  
  32. \n";
  33.  
  34. echo "Usage : php ".$_SERVER["PHP_SELF"]." dork untilpage\n\n";
  35.  
  36. $b = "https://www.google.com/search?q=";
  37.  
  38. $i = urlencode($argv[1]);
  39.  
  40. $n = "&first=";
  41.  
  42. $g = 1;
  43.  
  44. $id = $argv[2]*10-9;
  45.  
  46. while($g <= $id){
  47.  
  48. $gt = file_get_contents($b.$i.$n.$g);
  49.  
  50. preg_match_all('(<div class="sb_tlst">.*<h3>.*<a href="(.*)".*>.*</a>.*</h3>.*</div>)siU',$gt,$get);
  51.  
  52. $g=$g+10;
  53.  
  54. foreach($get[1] as $go){
  55.  
  56. $ctx = stream_context_create(array('http' => array('timeout' => 4)));
  57.  
  58. $ft = file_get_contents($go,false,$ctx);
  59.  
  60. if (preg_match("/error in your SQL syntax|mysql_fetch_array()|execute query|mysql_fetch_object()|mysql_num_rows()|mysql_fetch_assoc()|mysql_fetch&#8203;_row()|SELECT * FROM|supplied argument is not a valid MySQL|Microsoft OLE DB Provider for ODBC Drivers error|Syntax error|Fatal error/i",$ft)) {
  61.  
  62. echo urldecode($go)." >> Infected\n";
  63.  
  64. }
  65.  
  66. else{
  67.  
  68. echo urldecode("$go")."\n";
  69.  
  70. }
  71.  
  72. }}
  73.  
  74. ?>
Add Comment
Please, Sign In to add comment