• 解决IIS目录枚举

当前的IIS版本为7.5

【IIS】   => 【请求筛选】 => 【URL】中添加 【拒绝序列】 符号  ~ 

记录一次网站漏洞修复过程(二):第一轮处理(IIS目录枚举、应用程序错误)

  • 应用程序错误

 

在Global.asax 中添加异常处理代码,当程序出现异常后,记录异常,跳转到预先设置的页面,避免暴漏太多的细节

    void Application_Error(object sender, EventArgs e) 
    {  
        string errorMsg = String.Empty;
        Exception currentError = Server.GetLastError();
        errorMsg += "来自页面的异常处理<br />";
        errorMsg += "系统发生错误:<br />";
        errorMsg += "错误地址:" + Request.Url + "<br />";
        errorMsg += "错误信息:" + currentError.Message + "<br />";
        Log.WriteLog(errorMsg);
        Server.ClearError();
        Response.Redirect("~/err.html");
    }

 

相关文章:

  • 2021-05-24
  • 2022-12-23
  • 2021-09-01
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
猜你喜欢
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-11-19
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案