asp.net - IIS波浪号漏洞问题

标签 asp.net security iis url-rewriting

以下是我们网站上遇到的问题:

使用 Windows 文件系统简写字符和状态返回代码进行文件/目录名称暴力破解

It is possible to find an unknown filename up to six characters by using shorthand file characters such as ~1 and
    *Example: site.com/admin/uplo*~1*/.aspx
This attack relies on reading different error codes the webserver responds with when the file(s) exist or not. Let’s say the file upload.aspx exists in the directory admin. Our attacks responses would look like this:
    site.com/admin/uplo*~1*/.aspx – IIS returns HTTP 404 File Not Found (valid file)
    site.com/admin/uplp*~1*/.aspx – IIS returns HTTP 400 Bad Request (invalid file)
        *Note that IIS 7.x responds with different error codes (0×0 when valid) instead of http status codes

更多详情 http://www.alertlogic.com/internet-information-server-iis-exploitation-2/

可能的解决方案之一: ... 如果可能,您可能需要考虑使用 URL 重写来不允许接受任何带有波浪号字符的 URL ...

问题: 怎么做? url重写规则中应该使用什么正则表达式才能丢弃网站上所有URL中的~字符(ASP.NET 3.5)

最佳答案

可以通过执行以下任一操作来修复此问题:

1. Install .NET 4.0 on the web server. 

或者

2. Install and configure IIS URLScan module (do not allow ~ chars in the URL by adding ~ to [DenyUrlSequences] section).

在此处查找更多有用信息: http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx

关于asp.net - IIS波浪号漏洞问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11948857/

相关文章:

c# - 如何以编程方式在 EPiServer 10 中将页面设置为 "translate"

java - 散列 MAC 地址 Java/Android

c# - 验证密码的快速但安全的方法?

远程共享上的 IIS6 虚拟目录 500 错误

android - 在查看/解析 IIS 日志时,如何过滤掉来自移动应用程序而不是 Web 浏览器的对 API 的直接调用

c# - 加密 web.config 文件并提供文件路径

c# - 如何为数据集表分配表名

c# - asp.net 数据库连接

c# - ASP.NET Web 应用程序导出的 excel 文件上的警告弹出窗口

java - App Engine 使用对称密码