如果我向某个网站重复发帖一百万次,会发生什么情况?

发布于 2024-11-25 18:18:52 字数 141 浏览 1 评论 0原文

我只是想通过我的本地主机向网站发布一些内容以检索一些数据,突然,我想到了这个想法:如果我创建一个帖子,将其放入运行超过 100 万次的 for 循环中,并且向特定网址发送一百万次请求?我只是不想避免任何伤害,但我想知道。如果这可能会造成一些伤害,我该如何避免此类攻击?

I was just trying to post something to a website via my localhost to retrieve some data, and suddenly, this idea came to my mind: What happens if I create a post, put it into a for loop that runs over 1 million times, and send requests to a specific url for a million time? I just did not want to try to avoid any harm, but I wonder. And if this could cause some harm, how can I avoid such an attack?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

慵挽 2024-12-02 18:18:52

这种事情其实发生很多。有些是有意的,有些则不是。举个例子: http://en.wikipedia.org/wiki/Slashdot_effect

其他时候,这是故意的,这称为 DoS(拒绝服务)。许多网站都因这些攻击而被关闭,但并不总是涉及实际连接。它可能足以使底层操作系统的监听积压饱和。

如何避免它..基本上你不能。你可以尽最大努力去做,但你永远无法真正避免它。毕竟,您的网站是可以访问的,对吗?

this kind of things actually happen a lot. some are intentional and some are not. take for example: http://en.wikipedia.org/wiki/Slashdot_effect

other times, this is intentional, and its called a DoS (Denial Of Service). a lot of websites are taken down with these attacks, and not always involve an actual connection. it may suffice to saturate the listen backlog of the underlying os.

how to avoid it.. you cant, basically. you can make the best effort at it, but you will never be able to actually avoid it. after all, your website is there to be accessed, right?

如果没有你 2024-12-02 18:18:52

如果发生这种情况,您可以在防火墙中添加一条规则来阻止特定的 IP 地址。如果是复杂的拒绝服务,我确信 IP 地址是欺骗性的并且是随机的。但对于普通网站,您无需担心这一点。

You could add a rule in your firewall to block a specific IP address if that were to happen. If it is a sophisticated denial of service, I'm sure the IP address is spoofed and will be random. But for normal web sites, you won't need to worry about this.

掩耳倾听 2024-12-02 18:18:52

好吧,服务器将逐渐陷入困境,直到它弄清楚如何处理所有 1,000,000 个请求。除非您拥有传奇的硬件,否则它很可能会变得反应迟钝且几乎毫无用处,从而对每个想要访问它的人造成巨大的干扰。这称为拒绝服务攻击或 DOS。

您可以采取一些措施来防止这种情况发生:

  1. 要求用户在服务器处理他们的请求之前验证他们是人类。这通常是通过验证码完成的。
  2. 使用智能防火墙丢弃数据包或找出如何让服务器忽略来自发送过多 IP 地址的请求。
  3. 确保每个人都非常喜欢您的网站,以至于他们不会想到做任何事情来伤害它。

1 可能是最有效且最简单的,而 3 是不可能的。由于缺乏经验,我无法提供很多关于 2 的建议,而且它可能相当困难且容易利用。

短篇故事:使用验证码。 ;)

Well, the server will get progressively bogged down until it figures out how to handle all 1,000,000 of those requests. Odds are, unless you have legendary hardware, it will become unresponsive and next to useless, creating a great disruption to everyone wanting to access it. This is called a Denial Of Service attack, or a DOS.

There's a few things you can do to prevent this:

  1. Require users to verify that they are human before the server will process their request. This is usually done with Captchas.
  2. Use an intelligent firewall to drop the packets or figure out how to have the server ignore requests from IP addresses that have been sending too many.
  3. Make sure everybody loves your site so much that they wouldn't even think of doing anything to hurt it.

1 is probably most effective and simplest to do, and 3 is impossible. I can't offer a lot of advice about 2 due to lack of experience, and its probably fairly difficult and easy enough to exploit.

Short Story: Go with a Captcha. ;)

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