简体   繁体   English

我们如何关闭 asp.net 中的 webresource.axd 和 scriptresource.axd 漏洞?

[英]How we can close webresource.axd and scriptresource.axd vulnerability in asp.net.?

We have tried below code in web.config我们在 web.config 中尝试了以下代码

 <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/error.aspx" />

in your web.config, at the bottom just before the closing configuration tag put the following:在您的 web.config 中,在关闭配置标记之前的底部放置以下内容:

<location path="WebResource.axd">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
</location>

<location path="ScriptResource.axd">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
</location>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM