代码拉取完成,页面将自动刷新
685
修复 部分位置存在的目录内容泄露漏洞
已合并
这个不用多解释了吧……
(感觉自己最近提的PR好像变水了)
许多站长并不会主动配置去掉directory listing,然后一些信息就暴露出来了……
虽说Discuz是开源的,加了这个也一样知道目录结构,但穿个裤衩总还是比光屁股好一点的。
漏洞证明:
············
被发现了
function lookupdir($path) {
if ($handle = opendir($path)) {
$flag = 1;
$isempty = 1;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$isempty = 0;
$newpath = realpath($path.'/'.$file);
if (is_dir($newpath)) {
lookupdir($newpath);
} else {
if ($file == 'index.htm' || $file == 'index.html' || $file == 'index.php') {
$flag = 0;
}
}
}
}
if ($flag) {
if (!$isempty) {
file_put_contents($path.'/index.htm', '');
} else {
echo $path."\r\n";
}
}
closedir($handle);
}
}