Tu5b0l3d

Google dorker with dom

Jul 11th, 2016
2,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. /**
  3. by Tu5b0l3d | IndoXploit
  4. http://www.indoxploit.or.id/2016/06/google-dorker-new.html
  5. **/
  6. error_reporting(0);
  7.  
  8. function save($data){
  9.         $fp = @fopen("google_dom.htm", "a") or die("cant open file");
  10.         fwrite($fp, $data);
  11.         fclose($fp);
  12. }
  13. $links = array();
  14. $dork = "intext:IndoXploit";
  15. for($i=0;$i<=1000;$i+=10){
  16. $xml = new DOMDocument('1.0', "UTF-8");
  17.  
  18. $xml->loadHTMLFile("http://www.google.com/search?q=".urlencode($dork)."&start=$i");
  19. echo "ahh";
  20.  
  21.     foreach($xml->getElementsByTagName('cite') as $link) {
  22.        
  23.         $su =  "http://$link->nodeValue";
  24.        
  25.         $ahh = parse_url($su, PHP_URL_HOST);
  26.         if(in_array($ahh, $links) or preg_match("/blogspot/",$ahh)) {
  27.              echo "$ahh element is in the array";
  28. }
  29. else{
  30.     save("$ahh<br>");
  31.     $links[] = $ahh;
  32.     print_r($links);
  33. }
  34. }
  35. }
  36.  
  37.  
  38. ?>
Add Comment
Please, Sign In to add comment