Skip to content

Instantly share code, notes, and snippets.

@zhengkai
Created May 17, 2012 04:57
Show Gist options
  • Save zhengkai/2716507 to your computer and use it in GitHub Desktop.
Save zhengkai/2716507 to your computer and use it in GitHub Desktop.
扫域名
<?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);
}
}
@jvyyuie
Copy link

jvyyuie commented May 17, 2012

这么扫效率太低了、还容易卡死;另外一个情况就是扫出来的 No match 实际已经注册,是注册商主动留下了 No match 信息在whois里面,吸引人过去看他们的域名。

@zhengkai
Copy link
Author

有啥好建议

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment