当前位置: 首页 > 图文教程 > 网络编程 > ASP > 虚拟web目录容易泄露ASP源代码 (MS,缺陷)

ASP
深入研究Application和Session对象(2)
深入研究Application和Session对象(3)
开始 .Net的旅程(一)
开始 .Net的旅程(二)
手把手教你使用VB来创建ASP组件(1)
手把手教你使用VB来创建ASP组件(2)
手把手教你使用VB来创建ASP组件(3)
手把手教你使用VB来创建ASP组件(4)
手把手教你使用VB来创建ASP组件(5)
手把手教你使用VB来创建ASP组件(6)
手把手教你使用VB来创建ASP组件(7)
手把手教你使用Java来编写ASP组件(1)
手把手教你使用Java来编写ASP组件(2)
手把手教你使用Java来编写ASP组件(3)
手把手教你使用Java来编写ASP组件(4)
手把手教你使用Java来编写ASP组件(5)
手把手教你使用Java来编写ASP组件(6)
ASP 3.0高级编程(二十四)
ASP 3.0高级编程(二十五)
ASP 3.0高级编程(二十六)

虚拟web目录容易泄露ASP源代码 (MS,缺陷)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 116 ::
收藏到网摘: n/a

  涉及程序:
Microsoft Internet Information Server/Index Server
  
描述:
震撼安全发现:新的漏洞允许查看web服务器上任何文件包括ASP源码
  
详细:
IIS4.0上有一个应用程序映射htw--->webhits.dll,这是用于Index Server的点击功能的。尽管你不运行Index Server,该映
射仍然有效。这个应用程序映射存在漏洞,允许入侵者读取本地硬盘上的文件,数据库文件,和ASP源代码!
有两种方法来实现,第一,如果你的web server上存在.htw后缀的文件,则可以过下面的方式来查看文件内容,比如查看
odbc.ini文件的内容:

http://www.xxx.com/iissamples/issamples/oop/qfullhit.htw?
CiWebHitsFile=/../../winnt/odbc.ini&CiRestriction=none&CiHiliteType=Full

对于IIS的一般安装模式可以在下列位置找到.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


第二、如果你的web server上不存在这个文件,有漏洞的系统仍然允许用户调用webhits.dll,具体方式如下:

http://www.xxx.com/default.htm%20%20%20%20%20.htw?
CiWebHitsFile=/../../winnt/odbc.ini&CiRestriction=none&CiHiliteType=Full
条件是default.htm必须存在。这个文件名可以是其它文件,但必须存在。webhits.dll将会把这个文件作为临时文件打开。当上
述URL中的空格符%20达到一定数目时,web服务的识别功能可能会出现问题,这样webhits.dll将打开指定的文件
\winnt\odbc.ini。如果成功,用同样的方法可以打开更多的文件,包括ASP代码。近似的原理请见下面这段代码:

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;
}
}

解决方案:
不使用index server功能的用户,可以在IIS管理控制台中,点 web站点,属性,选择主目录,配置(起始点),应用程序映射,
将htw与webhits.dll的映射删除。
如果要用到webhits.dll,则使用下面的补丁:
Index Server 2.0(Intel机器)的补丁
Index Server 2.0(Alpha机器)的补丁
Windows2000的Index Server服务补丁
  
安全建议:
建议在IIS控制台中删除无用的应用程序映射
  
相关站点:
http://www.microsoft.com/technet/security/bulletin/ms00-006.asp

from: http://www.cnns.net/article/db/49.htm