服务器友好的慢速禁令。可能的?

发布于 2024-11-14 19:54:50 字数 188 浏览 4 评论 0原文

如何实现一个不是工具的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

稍尽春風 2024-11-21 19:54:50

如果您的 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.

你怎么这么可爱啊 2024-11-21 19:54:50

您可以将 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.

沉鱼一梦 2024-11-21 19:54:50

您可以在客户端而不是服务器端实现 Slowban,例如:

CSS:

body {
    visibility: hidden;
}

JavaScript:

$(document).ready(function() {
    window.setTimeout(function() {
        $("body").css("visibility", "visible");
    }, /* Slowban delay in miliseconds */);
});

这根本不会占用服务器。

为了进一步防止DoS攻击,您可以在后端安装防DoS软件(例如CloudFlare)。

You can implement the slowban client-side instead of server-side, e.g:

CSS:

body {
    visibility: hidden;
}

JavaScript:

$(document).ready(function() {
    window.setTimeout(function() {
        $("body").css("visibility", "visible");
    }, /* Slowban delay in miliseconds */);
});

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文