如何防止暴力攻击?
我正在研究身份验证并添加暴力保护。我不知道我应该如何继续。
我是否应该在某个 IP 地址尝试 15 次失败后进行平面阻止……还是应该将其与用户名绑定?是否应该同时存在验证码阈值和绝对截止值?
我还应该遵循其他模式吗?
I'm working on authentication and adding brute-force protection. I'm not sure how I should proceed.
Should I just do a flat block after 15 failed attempts for a certain IP address... or should I tie it to username? Should there be both a captcha threshold and a absolute cutoff?
Are there other patterns I should be following?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人真的尝试暴力破解,他可能有一系列 IP 可供使用。您可以做的是在每次尝试后增加延迟,并使其特定于用户名。验证码可以被击败(在不同程度上),因此设置一个验证码阈值,一个“放慢速度”的阈值,然后将其阻止一个小时。
请注意,暴力破解这种方式非常愚蠢,因此我更担心攻击者通过注入或其他方式从数据库获取密码的副本。
If someone is really trying a brute force, he may have a range of IPs to work with. What you could do is put an ever increasing delay after each try, and making it username specific. CAPTCHAs can be beaten (to varying degrees) so put a captcha treshold, a 'slow things down' threshold and then just block it for an hour.
Note that brute forcing this manner is incredibly stupid so I'd be more worried about the attacker getting a copy of the passwords from the database through an injection or whatever.