当前位置:编程学习 > 网站相关 >>

二级域名获取

#!/usr/bin/php
<?php
set_time_limit(0);
error_reporting(E_ERROR);
 
function geturl($keywords, $page, $num)
{    
        $page = ($page - 1) * 10;     
        $content = file_get_contents("http://www.google.com/search?sclient=psy-ab&hl=en&start=$page&source=hp&q=$keywords&pbx=1&oq=$keywords&num=$num&aq=f&aqi=g4");            
        $preg = '/<h3\s*class="r"\s*>.*/im';                     
        preg_match_all($preg, $content, $m);      
        preg_match_all('/<a(.*?)>(.*?)/', $m[0][0], $ms);
      
        $list = array();      
        foreach ($ms[1] as $link)
        {
                preg_match('/http:\/\/[a-zA-Z0-9._-]*/', $link, $matches);              
                if (!empty($matches[0]))
                {
                        $list[] = $matches[0];
                }
        }
        $list = array_unique($list);
        return $list;
}
 
 
 
    echo<<<INFO
----------------------------------
Google Get DNS Info T00l
blog:hi.baidu.com/nginxshell \n
Usage:\n <php> $argv[0]  \n
Example:\n site:baidu.com -inurl:zhidao.\n
----------------------------------\n
INFO;
 
if(file_exists('site.txt')){
  @unlink('site.txt');
  echo "Clear Cache ...\r\n";
  }
  echo "Please Enter GoogleDork: \r\n";
$GOOGLEDORK = urlencode(fgets(STDIN));
#echo $GOOGLEDORK;
#exit();
$page = 10;
$num = 100;
for ($i=1;$i<=$page;$i++)
{      
        $url = geturl($GOOGLEDORK, $i, $num);
        print_r('[+] Page: '.$i.' Results Count: '.count($url)."\r\n");      
            foreach ($url as $u)
            {
               #print_r($u."\r\n");
              @$fp=@fopen('tmp','a');
              @fwrite($fp,$u."\r\n");
              @fclose($fp);
              
            }

                $new_filename='site.txt';           
                $file=file('tmp');
                $array=preg_replace('/($\s*$)|(^\s*^)/m','',$file);
                foreach ($array as $key=>$r){
      
                     $array[$key]=trim("$r");
      
                    }
               $names=dirname(__FILE__).DIRECTORY_SEPARATOR.$new_filename;
               $new_array=array_values(array_unique($array));
              
        if(file_put_contents("$new_filename",join("\r\n",$new_array)))
           
                {
                    echo "Get Subdomain Success!\r\n\r\n";
                                        usleep(100000);
                                        echo "Save subdomains To:\r\n $names\r\n\r\n";
                                        usleep(100000);
                                        echo "GET URL IP...\r\n\r\n";
                                        $new_array=str_replace('http://',"",$new_array);
                                        $new_array=str_replace('https://',"",$new_array);
                                        foreach ($new_array as $key=>$r){
     &n
补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,