top
Loading...
虛擬web目錄容易泄露ASP源代碼(MS,缺陷)
涉及程序:
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;
}
}

解決方案:
不使用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

北斗有巢氏 有巢氏北斗