Thenothing has asked for the wisdom of the Perl Monks concerning the following question:
Dear friends, hello again, I hope you are doing fine
This thread is not relation to problem with code, but relation to opinión about this idea I implement for fun and test if work, all end work.
the target, is detect unsuccessful logins from user ip, and show recaptcha after 15 Attempts
I was looking for a way to keep records of failed attempts, but all information about this was create a database and save the records, time, user, unsuccessful logins, in the end I not want to install a db aplication, then I remember how work Fail2ban (Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs)
So I implement this method with this feautures:
* auto create file, when the file does no exist
* used pure perl to read and write file with open function
* used regex to get timestamp, user, date, etc
* show recaptcha when unsuccessful logins are > of 15 in period of time of 5 minutes or less
* remove all data just the line relation to user and ip, etc, and reset the timestamp every 12 hours
what do you think about this is idea, is bad ?
All is working good, I have a dude relation what happend when multiple user conect to page login and do brute force attent, that mean the function open have to write in parallel ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Custom log file to alternative to db
by jimpudar (Pilgrim) on May 21, 2018 at 18:40 UTC | |
|
Re: Custom log file to alternative to db
by Anonymous Monk on May 21, 2018 at 18:39 UTC | |
|