Advertisement
Kro0oz

Sqli Scanner Server

Jul 20th, 2015
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.12 KB | None | 0 0
  1. <?php
  2. @set_time_limit(0);
  3. @error_reporting(E_ALL | E_NOTICE);
  4.  
  5. if(!$argv[1] or !$argv[2]){
  6.  
  7. print_r("
  8. ================================================================================
  9. USAGE : php kro0oz.php [IP] [FILENAME]
  10. Ex    : php Kro0oz.php 127.0.0.1 Kro0oz.txt
  11.  
  12. ================================================================================
  13. ");
  14. die();
  15.  
  16. }
  17.  
  18.  
  19. function check_url($url,$source,$filename){ // by Mr.Kro0oz.305 !?
  20. if (preg_match("/error in your SQL syntax|mysql_fetch_array()|execute query|mysql_fetch_object()|mysql_num_rows()|mysql_fetch_assoc()|mysql_fetch_row()|SELECT * FROM|supplied argument is not a valid MySQL|Syntax error|Fatal error/i",$source))  {
  21. echo "[+] Found -> $url\n";
  22. $rr=fopen($filename,"a+");
  23. fwrite($rr,$url."\n");
  24. }
  25. else{ echo "[~] Not Found -> $url\n"; }
  26. }
  27.  
  28. function check_sql_inj($site,$filename2){
  29.     $result = @file_get_contents("$site%27");
  30.     check_url($site,$result,$filename2);
  31.     }
  32.  
  33. function mystripos($haystack, $needle){
  34.     return strpos($haystack, stristr( $haystack, $needle ));
  35.     }
  36.    
  37. function sec($ent)
  38. {
  39. $bb = str_replace("http://", "", $ent);
  40. $cc = str_replace("www.", "", $bb);
  41. $dd = substr($cc, 0, mystripos($cc, "/"));
  42. return $dd;
  43. }
  44. $npages = 50000;
  45.  
  46.   $npage = 1;
  47.   $allLinks = array();
  48.                 $ip = $argv[1];
  49.        
  50.   while($npage <= $npages)
  51.   {
  52.     $ch = curl_init();
  53.                                
  54.     curl_setopt($ch, CURLOPT_URL, 'http://www.bing.com/search?q=ip%3A' . $ip . '+id=&first=' . $npage);
  55.     curl_setopt($ch, CURLOPT_HEADER, 1);
  56.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  57.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
  58.     curl_setopt($ch, CURLOPT_REFERER, 'http://www.bing.com/');
  59.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8');
  60.  
  61.     $result['EXE'] = curl_exec($ch);
  62.     $result['ERR'] = curl_error($ch);
  63.  
  64.     curl_close($ch);
  65.  
  66.     if ( empty( $result['ERR'] ) )
  67.     {
  68.         preg_match_all('(<div class="sb_tlst">.*<h3>.*<a href="(.*)".*>(.*)</a>.*</h3>.*</div>)siU', $result['EXE'], $findlink);
  69.         for ($i = 0; $i < count($findlink[1]); $i++)
  70.         array_push($allLinks,$findlink[1][$i]);
  71.  
  72.  
  73.         $npage = $npage + 10;
  74.         if (preg_match('(first=' . $npage . '&amp)siU', $result['EXE'], $linksuiv) == 0)
  75.             break;             
  76.     }
  77.     else
  78.         break;
  79.   }
  80.  
  81. $allDmns = array();
  82.  
  83.  
  84.  
  85.     foreach ($allLinks as $kk => $vv){
  86.     $allDmns[] = $vv;
  87.     }
  88.     $resultPages = array_unique($allDmns);
  89.     sort($resultPages) ;
  90.    
  91. print_r("
  92. =================================================================
  93.  
  94.  SQL Injection Server ScaNNer v1.0
  95.  
  96.    Coded by Mr.Kro0oz.305
  97.  
  98.   ( r2r@hotmail.com )
  99.  
  100. (Y)
  101. ================================================================================
  102. ");
  103.  
  104. for ($x = 0; $x < count($resultPages); $x++){
  105. $h3h3 = $resultPages[$x];
  106. check_sql_inj($h3h3,$argv[2]);
  107. }
  108.  
  109. print_r("
  110. ================================================================================
  111.            INFO / IP : ".$ip." / Domine ScaNNed : ".count($resultPages)."
  112.            
  113.                          FINISHED
  114.                              
  115. ================================================================================
  116. ");
  117. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement