首页 > 服务器 > Web服务器 > 正文

如何加强asp.net 1.1 / 2.0 安全性--防跨站攻击

2024-09-01 13:47: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>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表