3xploit3r

Mini Bing Dorker

Aug 23rd, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <?php
  2.  
  3. print "
  4.           Mr.MaGnoM
  5. mini bing dorker
  6. https://www.facebook.com/mr.magnom2/
  7. http://magsec.blogspot.com/
  8. ";
  9.  
  10.  
  11. // function getsource is not made by me .
  12. // usage : php script.php
  13.  
  14. function getsource($url, $proxy) {
  15.     $curl = curl_init($url);
  16.     curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5");
  17.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  18.     if ($proxy) {
  19.         $proxy = explode(':', autoprox());
  20.         curl_setopt($curl, CURLOPT_PROXY, $proxy[0]);
  21.         curl_setopt($curl, CURLOPT_PROXYPORT, $proxy[1]);
  22.     }
  23.     $content = curl_exec($curl);
  24.     curl_close($curl);
  25.     return $content;
  26. }
  27.  
  28. echo "\n\t ur dork here : ";$dork=trim(fgets(STDIN,1024));
  29. $do=urlencode($dork);
  30.         //$ip="200.58.111.34";
  31.         $npage = 1;
  32.         $npages = 30000;
  33.         $allLinks = array();
  34.         $lll = array();
  35.         while($npage <= $npages) {
  36.             $x = getsource("http://www.bing.com/search?q=".$do."&first=" . $npage."&FORM=PERE4", $proxy);
  37.             if ($x) {
  38.                 preg_match_all('#<h2><a href="(.*?)" h="ID#', $x, $findlink);
  39.                 foreach ($findlink[1] as $fl) array_push($allLinks, $fl);
  40.                 $npage = $npage + 10;
  41.                 if (preg_match("(first=" . $npage . "&amp)siU", $x, $linksuiv) == 0) break;
  42.             } else break;
  43.         }
  44.         $URLs = array();
  45.         foreach($allLinks as $url){
  46.             $exp = explode("/", $url);
  47.             $URLs[] = $exp[2];
  48.         }
  49.         $array = array_filter($URLs);
  50.         $array = array_unique($array);
  51.         $sss=count(array_unique($array));
  52.         echo"\nToTaL SiTe : ". $sss.'';
  53.  
  54.         foreach ($array as $domain) {
  55.  
  56.             echo"\nhttp://".$domain.'/';
  57.  
  58.         }
  59. ?>
Add Comment
Please, Sign In to add comment