Advertisement
Jemb0t_IR3eng

GoDork, Google Dorker Tanpa Captcha & Proxy

Jun 19th, 2019
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.55 KB | None | 0 0
  1. <?php
  2. /**
  3. * -------- GOOGLE DORKER v1--------
  4. *
  5. * @Author : Izzeldin Addarda [ Security Ghost ]
  6. * @Big Thanks for Teguh Aprianto about the Google CSE Key!
  7. *
  8. **/
  9. define('CSE_TOKEN', 'partner-pub-2698861478625135:3033704849');
  10.     function Curl ($url, $post = 0, $headers = 0, $proxy = 0){
  11.         $ch = curl_init();
  12.         $options = array(
  13.             CURLOPT_URL => $url,
  14.             CURLOPT_RETURNTRANSFER => true,
  15.             CURLOPT_SSL_VERIFYPEER => false,
  16.             CURLOPT_SSL_VERIFYHOST => false,
  17.             CURLOPT_FOLLOWLOCATION => true,
  18.             CURLOPT_TIMEOUT        => 30,
  19.             CURLOPT_HEADER         => true,
  20.         );
  21.         if($proxy){
  22.             $options[CURLOPT_PROXY] = $proxy;
  23.             $options[CURLOPT_PROXYTYPE] = CURLPROXY_SOCKS5;
  24.         }
  25.         if($post){
  26.             $options[CURLOPT_POST] = true;
  27.             $options[CURLOPT_POSTFIELDS] = $post;
  28.         }
  29.         if($headers){
  30.             $options[CURLOPT_HTTPHEADER] = $headers;
  31.         }
  32.         curl_setopt_array($ch, $options);
  33.         $response = curl_exec($ch);
  34.         $httpcode = curl_getinfo($ch);
  35.         if(!$httpcode) return "Curl Error : ".curl_error($ch); else{
  36.             $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  37.             $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  38.             curl_close($ch);
  39.             return array($header, $body);
  40.         }
  41.     }
  42.     function get_string($string, $start, $end){
  43.         $str = explode($start, $string);
  44.         $str = explode($end, $str[1]);
  45.         return $str[0];
  46.     }
  47.     function banner (){
  48.         print " _______       ______             _\n";    
  49.         print "(_______)     (______)           | |\n";    
  50.         print " _   ___  ___  _     _ ___   ____| |  _\n";
  51.         print "| | (_  |/ _ \| |   | / _ \ / ___) |_/ )\n";
  52.         print "| |___) | |_| | |__/ / |_| | |   |  _ ( \n";
  53.         print " \_____/ \___/|_____/ \___/|_|   |_| \_)\n";
  54.         print " Version : 1.0   | By Mazterin.Com\n\n";
  55.     }
  56.     banner();
  57.     echo "# DORK : "; $dork = fgets(STDIN);
  58.     $i = 0;
  59.     while(true){
  60.         $headers = array();
  61.         $headers[] = 'Referer: https://cse.google.com/cse?cx='.CSE_TOKEN;
  62.         $headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.'.rand(0000, 3333).'.169 Safari/537.36';
  63.         $getInfo = Curl("https://cse.google.com/cse.js?hpg=1&cx=".CSE_TOKEN, 0, $headers);
  64.         preg_match('#"cselibVersion": "(.*?)"#si', $getInfo[1], $csiLib); // CSILIB
  65.         preg_match('#"cx": "(.*?)"#si', $getInfo[1], $cx); // CX
  66.         preg_match('#"cse_token": "(.*?)"#si', $getInfo[1], $cseToken); // CSE TOKEN
  67.         preg_match('#"exp": \["(.*?)", "(.*?)"\]#si', $getInfo[1], $exp); // EXP
  68.         preg_match('#"resultSetSize": "(.*?)"#si', $getInfo[1], $rsz); // RSZ
  69.         $url = "https://cse.google.com/cse/element/v1?rsz=".$rsz[1]."&num=10&&start=".$i."&hl=en&source=gcsc&gss=.com&cselibv=".$csiLib[1]."&cx=".$cx[1]."&q=".rawurlencode($dork)."&safe=off&cse_tok=".$cseToken[1]."&exp=".$exp[1].",".$exp[2]."&callback=google.search.cse.api16950";
  70.         $json = Curl($url, 0, $headers);
  71.         preg_match_all('#"clicktrackUrl": "(.*?)"#si', $json[1], $trackUrl);
  72.         if($trackUrl[1] != NULL){
  73.             foreach($trackUrl[1] as $index => $key){
  74.                 echo urldecode(get_string($key, '&q=', '&sa'))."\n";
  75.             }
  76.         }else{
  77.             echo "{!} DONE!\n";
  78.             exit();
  79.         }
  80.         $i = $i+10;
  81.     }
  82. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement