Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Jenny Swift
Jenny Swift
21,999 Points

What are the chances of my site being brute-force attacked from more than one computer?

To make sure my idea of a brute-force attack is correct, what I mean is someone or a bot attempting many passwords in order to try and log in to my site.

And I’ve heard I shouldn’t code my own defense against this sort of thing, but why? I thought it might simply be a matter of adding some columns to my users table such as time of last failed login and number of failed logins, and check those whenever a login is attempted. What could go wrong with that?

If I shouldn’t code my own defense, what is the alternative please? I’m using Laravel and Laravel Throttle has been recommended, but I don’t think it would protect against attacks from more than one computer.

1 Answer

Ricky Catron
Ricky Catron
13,023 Points

There is no reason not to code your own defense. Simply don't do the WHOLE thing yourself such as hashs or encryption. Here is a good stackoverflow question discussing ways to prevent a BotNet or DDos attack.

Your idea is one of the ones suggested. Personally I have never needed something like this but a site with a large audience and important information might.

Chances of this happening go up exponentially with the value of your site. I assume Twitter and Facebook defend against them every once in a while but a local mom and pops shop might never see one.

Goodluck! --Ricky

Jenny Swift
Jenny Swift
21,999 Points

Thank you Ricky, it's nice to know I can have a go at coding it myself.