首页 -> 安全研究

安全研究

安全漏洞
Microsoft Windows Index Server远程目录遍历漏洞(MS00-006)

发布日期:2000-01-26
更新日期:2000-01-26

受影响系统:
Microsoft Index Server 2.0
    - Microsoft Windows NT 4.0
    - Microsoft Windows 2000 SP3
描述:
BUGTRAQ  ID: 950
CVE(CAN) ID: CVE-2000-0097

Microsoft Index Server是Windows NT 4.0可选安装包中包括的一个基于Web的搜索引擎,在Windows 2000系统中作为一个服务安装。

Internet Information Server 4.0中一个ISAPI应用程序webhits.dll存在安全漏洞,允许攻击者突破WEB的虚拟文件系统,获得对在同一个逻辑驱动器中其它文件(如用户数据库、日志文件等任何能猜测路径名和文件名的文件)的非法访问。

Webhits.dll动态链接库与.htw文件关联。但即使在系统中没有任何.htw文件,仍然可能有问题。检查系统是否存在这个安全问题的是输入:[URL=http://your_web_server_address/nosuchfile.htw,如果返回信息类似"format]http://your_web_server_address/nosuchfile.htw,如果返回信息类似"format[/URL] of the QUERY_STRING is invalid",那么就说明存在安全问题。



<*来源:David Litchfield
  
  链接:http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q251170&
        http://www.microsoft.com/technet/security/bulletin/MS00-006.asp
        http://www.cerberus-infosec.co.uk/adviishtw.html
        http://www.microsoft.com/technet/security/bulletin/MS01-025.asp
*>

测试方法:

警 告

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

David Litchfield 提供了如下测试方法:

1)如果在系统中有.htw文件
****************************************
客户端请求的文档作为.htw的CiWebHitsFile参数传递给webhits.dll,这个文档可由客户端任意指定。由于webhits.dll没有过滤"../",使攻击者可以访问WEB虚拟目录外的文件。

以下实例用于查看web访问日志:

http://charon/iissamples/issamples/oop/qfullhit.htw?
CiWebHitsFile=/../../winnt/system32/logfiles/w3svc1/ex000121.log
&CiRestriction=none&CiHiliteType=Full

.htw实例文件通常安装在以下目录:

/iissamples/issamples/oop/qfullhit.htw
/iissamples/issamples/oop/qsumrhit.htw
/iissamples/exair/search/qfullhit.htw
/iissamples/exair/search/qsumrhit.htw
/iishelp/iis/misc/iirturnh.htw

2)如果系统中没有任何.htw文件
**************************************************
诀窍是通过一个巧妙的URL使inetinfo.exe调用webhits.dll,然后通过webhits.dll访问系统中的文件。首先需要一个可用的静态文件,如.htm、.html、.txt、.gif或.jpg等,以下URL

http://charon/default.htm.htw?CiWebHitsFile=/../../winnt/system32/
logfiles/w3svc1/ex000121.log&CiRestriction=none&CiHiliteType=Full

会返回出错信息,因为系统中并不存在default.htm.htw文件。但实际上这个文件名已经由inetinfo.exe程序传递给webhits.dll。由于处理这个文件参数的缓冲区大小固定,在复制参数时会截断超过缓冲区大小的部份(防止缓冲区溢出)。只要在实际存在的静态文件default.htm和.htw间插入足够多的空格(%20),就能够只将"default.htm"字符串传递给webhits.dll,从而使webhits.dll成功打开该文件并返回我们需要的文件内容。

系统对这个文件参数的处理类似于:

FILE *fd;
int DoesTemplateExist(char *pathtohtwfile)
{

// Just in case inetinfo.exe passes too long a string
// let's make sure it's of a suitable length and not
// going to open a buffer overrun vulnerability

char *file;

file = (char *)malloc(250);
strncpy(file,pathtohtwfile,250);
fd = fopen(file,"r");

// Success
if(fd !=NULL)
  {
   return 1;
  }
// failed
else
  {
   return 0;
  }
}

建议:
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

* 用Internet Server Manager取消webhits.dll与.htw文件的关联。

厂商补丁:

Microsoft
---------
Microsoft已经为此发布了一个安全公告(MS00-006)以及相应补丁:
MS00-006:Patch Available for "Malformed Hit-Highlighting Argument" Vulnerability
链接:http://www.microsoft.com/technet/security/bulletin/MS00-006.asp

补丁下载:

Index Server 2.0:
- Intel:
   http://www.microsoft.com/downloads/release.asp?ReleaseID=17727
- Alpha:
   http://www.microsoft.com/downloads/release.asp?ReleaseID=17728

Indexing Services for Windows 2000:
- Intel:
   http://www.microsoft.com/downloads/release.asp?ReleaseID=17726

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