Created
May 17, 2012 04:57
-
-
Save zhengkai/2716507 to your computer and use it in GitHub Desktop.
扫域名
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sEnd = "no"; | |
$sNoMatch = "No match"; | |
$lChar = str_split("abcdefghijklmnopqrstuvwxyz", 1); | |
$lNum = range(0, 9); | |
foreach ($lChar as $a) { | |
foreach ($lChar as $b) { | |
$sDomain = $a.$b; | |
echo $sDomain; | |
echo " "; | |
$sDomain .= ".".$sEnd; | |
exec("whois ".$sDomain, $lOutput); | |
$sOutput = implode("\n", $lOutput); | |
echo $sOutput; | |
if (strpos($sOutput, $sNoMatch) !== FALSE) { | |
echo "\n".$sDomain; | |
file_put_contents("domain_".$sEnd.".txt", $sDomain."\n", FILE_APPEND); | |
} | |
sleep(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这么扫效率太低了、还容易卡死;另外一个情况就是扫出来的 No match 实际已经注册,是注册商主动留下了 No match 信息在whois里面,吸引人过去看他们的域名。