php超简单扫二级域名

本帖最后由 jjf012 于 2012-6-19 10:12 编辑


<?php
$s="你的网址";//比如baidu.com即可
$file = 'url.txt';
$content = file_get_contents($file);
$array = explode("\r\n", $content);
//Output a line of the file until the end is reached
foreach($array as &$line){
	echo "http://".$line.$s."\r\n";
	$ock=@get_headers('http://'.$line.$s);
	if(!$ock){
		echo "faild!\r\n";
	}
	else
	{
		echo "success!\r\n";
		$site_list = file('site.txt');
		if (in_array("http://".$line.$s."\r\n", $site_list)){
			echo "[-]  Links repeat\n";
		}else{
			$fp = @fopen('site.txt', 'a'); 
			@fwrite($fp,"http://".$line.$s."\r\n");
			@fclose($fp);
		}
	}
}
?>

{:4_51:} 自己试着试着写出来了。
url.txt放比如www.这种格式的。每行回车。

原创哟~

需要字典吧?

**回复 3# alibaba **

是的。自己可以加嘛。

不懂 ,扫出来的二级域名会全面 ?

{:4_87:}这个东西我都是用以前整理箱子的那个工具来扫的 不过很少扫 一个字典+探测页面就行了 不时
用

不会写代码的表示支持下~

建议curl 函数 速度比较快

强烈支持原创作品,原创思路

求字典

**回复 10# kn1f3 **

没字典的说,我记得bt5下面dns枚举那一栏有类似功能的脚本,你可以去看看那里有没有自带字典。