服务器友好的慢速禁令。可能的?
如何实现一个不是工具的 slowban对我们的网站进行 DoS 攻击?
问题在于,故意延迟提供 http 响应将使服务器资源(Web 服务器线程和可能的其他子系统)保持繁忙。
How is it possible to implement a slowban that will not be a tool for DoS to our site?
The problem is that a deliberate delay in serving an http response will keep server resources busy (web server threads and possibly other subsystems).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的 Web 应用程序很复杂并占用大量资源,那么由于 慢速攻击。
相反,您可以通过轻量级代理或网络服务器(如 lighttpd 或 nginx)代理您的应用程序,从缓存和静态内容提供服务并利用防火墙来引入 Slowban。从那里,您可以在防火墙中调整带宽,使所需的资源保持相对较低,因为巨魔的连接主要由轻量级代理而不是重型应用程序服务器提供服务。
虽然这本身存在一些需要考虑的危险(即使可能不安全的应用程序能够在防火墙中插入基于 ip 的规则),但 iptables 和内核在资源上相对容易。
您唯一需要考虑的是系统可以容忍的开放连接数量以及何时开始终止最长的开放连接以为新连接腾出空间。明确让您的网站做好对抗低带宽的准备 - 攻击。
If your web application is complex and takes up considerable resources, it might be the wrong place to implement a slowban due to the problematic of a slowloris-attack.
Instead, you could introduce the slowban by proxying your application through a lightweight proxy or webserver like lighttpd or nginx serving from cache and static content and utilizing your firewall. From there, you may shape the bandwidth in your firewall, keeping the needed resources relatively low, as the connection of a troll is mainly served by the lightweight proxy instead of your heavy application server.
While this has some dangers to consider in itself (namely to enable a possibly insecure application to insert ip-based rules in your firewall), iptables and the kernel are relatively easy on resources.
The only thing you have to consider is the amount of open connections your system may tolerate and when to start killing the longest open connections to make room for new ones. Definetly prepare your site for fighting against low bandwidth-attacks.
您可以将 Slowban 与资源监控结合起来,这样,如果被 Slowban 限制的用户明显试图执行 DoS,他们将被永久禁止。
You could incorporate the slowban with resource monitoring so that if it becomes apparent the slowbanned user is attempting to DoS, they will be permabanned instead.
您可以在客户端而不是服务器端实现 Slowban,例如:
CSS:
JavaScript:
这根本不会占用服务器。
为了进一步防止DoS攻击,您可以在后端安装防DoS软件(例如CloudFlare)。
You can implement the slowban client-side instead of server-side, e.g:
CSS:
JavaScript:
This won't hog down the server at all.
To further prevent DoS attacks, you can install anti-DoS software (such as CloudFlare) on your backend.