危害级别:轻微
IIS短文件名泄露漏洞
WASC Threat Classification
描述: Microsoft IIS在实现上存在文件枚举漏洞,攻击者可利用此漏洞枚举网络服务器根目录中的文件。
1.Internet Information Services(IIS,互联网信息服务)是由微软公司提供的基于运行Microsoft Windows的互联网基本服务。
Microsoft IIS在实现上存在文件枚举漏洞,攻击者可利用此漏洞枚举网络服务器根目录中的文件。
危害: 攻击者可以利用“~”字符猜解或遍历服务器中的文件名,或对IIS服务器中的.Net Framework进行拒绝服务攻击。
解决方案:
1.关闭NTFS 8.3文件格式的支持。该功能默认是开启的,对于大多数用户来说无需开启。
如果是虚拟主机空间用户,请联系空间提供商进行修复。
修改方法:
1)修改注册列表HKLM\SYSTEM\CurrentControlSet\Control\FileSystem \NtfsDisable8dot3NameCreation的值为1,或者,可以直接点此下载,然后运行,再重启下机器。(此修改只能禁止 NTFS8.3格式文件名创建,已经存在的文件的短文件名无法移除),
2)如果你的web环境不需要asp.net的支持你可以进入Internet 信息服务(IIS)管理器 — Web 服务扩展 – ASP.NET 选择禁止此功能。
3)升级net framework 至4.0以上版本.
攻击者可以利用“~”字符猜解或遍历服务器中的文件名,或对IIS服务器中的.Net Framework进行拒绝服务攻击。
HRay注:这漏洞是7月3号在微博上看到的,bin牛说有人拿这个洞扫他的站,于是看了下提供的pdf,意外的没用google翻译看懂了这篇英文文档,发现还是挺有意思的,这里写出来希望对大家有帮助。
漏洞介绍:http://www.exploit-db.com/exploits/19525/
这里我以在乌云提交的一个漏洞来做实例,里面只讲到了部分原理,想看详细原理的朋友可以参考exploit-db提供的pdf,这个漏洞由于是第三方已经被厂商忽略了,提前向公众公开,所以正好拿出来写在blog上。
完 美时空某分站存在短文件名泄露,首先判断漏洞是否存在,找一个存在的文件http://perfectrisingstar.wanmei.com /Views/findpwd.aspx,利用通配符加短标签构造出http://perfectrisingstar.wanmei.com /Views/fa*~1*/.aspx访问这个地址IIS会返回给我们一个错误,大多数是bad request错误
说明不存在fa开头的文件或目录,构造http://perfectrisingstar.wanmei.com/Views/fi*~1*/.aspx返回404,说明存在以fi开头的文件
利 用这个特性我们仅需要对每一位循环遍历26个字母就可以获取文件短文件名称,由于短文件名的规律为前6个字符+~1-9+扩展名前三位,我们可以根据短文 件名结果推测或配合字典暴力猜测文件全名,测试后缀名构造http://perfectrisingstar.wanmei.com/Views /findpw~1.*/.aspx即可
有些扩展名为2个字符,我们可以用http://perfectrisingstar.wanmei.com/Views/findpw~1.%3f%3f/.aspx单独位匹配测试
这里返回错误,所以扩展名不是2个字符
http://perfectrisingstar.wanmei.com/Views/findpw~1.a%3f%3f/.aspx返回404,说明存在a开头3位以上的扩展名
我们现在大概知道了部分原理和利用方法,直接用poc跑一下看看结果
转自:http://hi.baidu.com/zh2089/item/08c3ed33f21021332e0f819e
————————————————————————————————————————–
PoC: http://www.exploit-db.com/sploits/19525.zip
Paper: http://www.exploit-db.com/download_pdf/19527
Security Research – IIS Short File/Folder Name Disclosure
Website : http://soroush.secproject.com/blog/
I. BACKGROUND
———————
“IIS is a web server application and set of
feature extension modules created by Microsoft for use with Microsoft Windows.
IIS is the third most popular server in the world.” (Wikipedia)
II. DESCRIPTION
———————
Vulnerability Research Team discovered a vulnerability
in Microsoft IIS.
The vulnerability is caused by a tilde character “~” in a Get request, which could allow remote attackers
to diclose File and Folder names.
III. AFFECTED PRODUCTS
—————————
IIS 1.0, Windows NT 3.51
IIS 2.0, Windows NT 4.0
IIS 3.0, Windows NT 4.0 Service Pack 2
IIS 4.0, Windows NT 4.0 Option Pack
IIS 5.0, Windows 2000
IIS 5.1, Windows XP Professional and Windows XP Media Center Edition
IIS 6.0, Windows Server 2003 and Windows XP Professional x64 Edition
IIS 7.0, Windows Server 2008 and Windows Vista
IIS 7.5, Windows 7 (error remotely enabled or no web.config)
IIS 7.5, Windows 2008 (classic pipeline mode)
Note: Does not work when IIS uses .Net Framework 4.
IV. Binary Analysis & Exploits/PoCs
—————————————
Tilde character “~” can be used to find short names of files and folders when the website is running on IIS.
The attacker can find important file and folders that they are not normaly visible.
In-depth technical analysis of the vulnerability and a functional exploit
are available through:
http://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/
V. SOLUTION
—————-
There are still workarounds through Vendor and security vendors.
Using a configured WAF may be usefull (discarding web requests including the tilde “~” character).
VI. CREDIT
————–
This vulnerability was discovered by:
Soroush Dalili (@irsdl)
Ali Abbasnejad
VII. REFERENCES
———————-
http://support.microsoft.com/kb/142982/en-us
http://soroush.secproject.com/blog/2010/07/iis5-1-directory-authentication-bypass-by-using-i30index_allocation/
VIII. DISCLOSURE TIMELINE
—————————–
2010-08-01 – Vulnerability Discovered
2010-08-03 – Vendor Informed
2010-12-01 – Vendor 1st Response
2011-01-04 – Vendor 2nd Response (next version fix)
2012-06-29 – Public Disclosure