IIS7.0默认开启了不安全的OPTIONS和TRACE方法,建议关闭这两个方法。 以下环境为windows server 2008、IIS7.0 方法(1):web.config 在<configuration>节点下添加如下代码: <system.webServer> <security> <requestFiltering> <verbs allowUnlisted="false"> <add verb="GET" allowed="true"/> <add verb="POST" allowed="true"/> <add verb="HEAD" allowed="true"/> </verbs> </requestFiltering> </security></system.webServer>
以上代码只允许开启GET、POST和HEAD方法。 allowUnlisted="false":拒绝未列出的谓词。 方法(2):IIS7.0 --> “请求筛选”-->"编辑功能设置"-->"不允许未列出的谓词"-->"HTTP谓词"-->"添加允许谓词" 添加“允许”和“拒绝”规则,特定谓词只能填一个。 方法(3):IIS7.0 --> applicationHost.config 文件位置:C:/Windows/System32/inetsrv/config/
参考文献: http://technet.microsoft.com/zh-cn/library/86bb183f-a016-40ca-b9c3-bbb2f5c8a4b5.aspx http://www./learn/manage/configuring-security/use-request-filtering http://technet.microsoft.com/zh-cn/library/hh831621 |
|