如果我向某个网站重复发帖一百万次,会发生什么情况?
我只是想通过我的本地主机向网站发布一些内容以检索一些数据,突然,我想到了这个想法:如果我创建一个帖子,将其放入运行超过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这种事情其实发生很多。有些是有意的,有些则不是。举个例子: 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?
如果发生这种情况,您可以在防火墙中添加一条规则来阻止特定的 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.
好吧,服务器将逐渐陷入困境,直到它弄清楚如何处理所有 1,000,000 个请求。除非您拥有传奇的硬件,否则它很可能会变得反应迟钝且几乎毫无用处,从而对每个想要访问它的人造成巨大的干扰。这称为拒绝服务攻击或 DOS。
您可以采取一些措施来防止这种情况发生:
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 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. ;)