gpt4 book ai didi

asp.net - 检测 URL 滥用和黑客攻击

转载 作者:行者123 更新时间:2023-12-02 04:17:58 24 4
gpt4 key购买 nike

我有一个网站似乎获得的黑客攻击次数超过了它的公平份额。它尚未被破坏,但我想在系统中构建一种检测尝试并阻止 IP 的好方法。

检测这种情况的最佳方法是简单地对“varchar”和“sysobjects”等短语进行字符串搜索吗?

违规网址:http://www.example.com/default.aspx?id=58和 char(124)+(Select Cast(Count(1) as varchar(8000))+char(124) From [sysobjects] where 1=1)>0

来源:System.Web

消息:引发了“System.Web.HttpUnhandledException”类型的异常。

用户IP:187.13.142.33

用户浏览器:未知 0.0

用户操作系统:未知

堆栈跟踪:在 System.Web.UI.Page.HandleError(Exception e) 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint ) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 在 System.Web.UI.Page.ProcessRequest(HttpContext context) 在 ASP.default_aspx.ProcessRequest(HttpContext context ) 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤, bool 同步完成)

最佳答案

Would the best way to detect this be to simply do a string search for phrases like "varchar" and "sysobjects"?



如果您在看到它们时要立即抛出异常,则不会......那么如果用户决定他们想要例如,您将破坏您的应用程序。在您的网站上搜索有关 varchars 的信息。

如果您的应用程序编写正确,那么像这样的“XSS 保护”黑客除了这些偶尔的破坏之外什么都没有。如果您的应用程序没有正确编写,那么“保护”充其量只是一种无效的混淆。

您当然可以记录看起来可能是攻击的请求,以便稍后查看攻击者 IP。不幸的是,这往往没有您想象的那么有用,因为许多攻击脚本都在受感染的服务器和僵尸网络特洛伊木马的网络上运行,有大量的 IP 地址可供选择。

关于asp.net - 检测 URL 滥用和黑客攻击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1710691/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com