What is the best Distributed Brute Force countermeasure?

前端 未结 16 1864
逝去的感伤
逝去的感伤 2020-11-28 16:55

First, a little background: It is no secret that I am implementing an auth+auth system for CodeIgniter, and so far I\'m winning (so to speak). But I\'ve run into a pretty no

16条回答
  •  执笔经年
    2020-11-28 17:27

    If I understand the MO of brute force attacks properly, then one or more usernames are tried continuously.

    There are two suggestions which I don't think I've seen yet here:

    • I always thought that the standard practice was to have a short delay (a second or so) after each wrong login for every user. This deters brute-force, but I don't know how long a one second delay would keep a dictionary attack at bay. (dictionary of 10,000 words == 10,000 seconds == about 3 hours. Hmm. Not good enough.)
    • instead of a site-wide slow down, why not a user-name throttle. The throttle becomes increasingly harsh with each wrong attempt (up to a limit, I guess so the real user can still login)

    Edit: In response to comments on a username throttle: this is a username specific throttle without regard to the source of the attack.

    If the username is throttled, then even a coordinated username attack (multi IP, single guess per IP, same username) would be caught. Individual usernames are protected by the throttle, even if the attackers are free to try another user/pass during the timeout.

    From an attackers point of view, during the timeout you may be able to take a first time guess at 100 passwords, and quickly discover one wrong password per account. You may only be able to make a 50 second guesses for the same time period.

    From a user account point of view, it still takes the same average number of guesses to break the password, even if the guesses are coming from multiple sources.

    For the attackers, at best, it will be the same effort to break 100 accounts as it would 1 account, but since you're not throttling on a site wide basis, you can ramp up the throttle quite quickly.

    Extra refinements:

    • detect IPs that are guessing multiple accounts - 408 Request Timeout
    • detect IPs that are guessing the same account - 408 Request Timeout after a large (say 100) number of guesses.

    UI ideas (may not be suitable in this context), which may also refine the above:

    • if you are in control of the password setting, then showing the user how strong their password is encourages them to pick a better one.
    • if you are in control of the login page, after a small (say 10) number of guesses of a single username, offer a CAPTCHA.

提交回复
热议问题