如何加强asp.net 1.1 / 2.0 安全性--防跨站攻击
作者:jit 日期:2008-09-24
ASP.NET 1.1:
打开 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
设置:
< location allowOverride="false">
< identity impersonate="true" userName="" password=""/>
ASP.NET 2.0 以上:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
设置:
< identity impersonate="true"/>
如果没有此两项,分别进行增加:
< location allowOverride="true"> 改为:< location allowOverride="false">
< system.web>
< securityPolicy>
< trustLevel name="Full" policyFile="internal"/>
< trustLevel name="High" policyFile="web_hightrust.config"/>
< trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
< trustLevel name="Low" policyFile="web_lowtrust.config"/>
< trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
< /securityPolicy>
< trust level="Full" originUrl=""/>
< identity impersonate="true"/> < !-- 这里增加 -->
< /system.web>
< /location>
打开 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
设置:
< location allowOverride="false">
< identity impersonate="true" userName="" password=""/>
ASP.NET 2.0 以上:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
设置:
< identity impersonate="true"/>
如果没有此两项,分别进行增加:
< location allowOverride="true"> 改为:< location allowOverride="false">
< system.web>
< securityPolicy>
< trustLevel name="Full" policyFile="internal"/>
< trustLevel name="High" policyFile="web_hightrust.config"/>
< trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
< trustLevel name="Low" policyFile="web_lowtrust.config"/>
< trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
< /securityPolicy>
< trust level="Full" originUrl=""/>
< identity impersonate="true"/> < !-- 这里增加 -->
< /system.web>
< /location>
[本日志由 jit 于 2011-07-24 01:30 PM 编辑]
上一篇: 解决 错误 'ASP 0178 : 80070005' 下一篇: 空间子目录绑定JS代码实现
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论