We don't bite newbies here... much | |
PerlMonks |
Custom log file to alternative to dbby Thenothing (Sexton) |
on May 21, 2018 at 17:37 UTC ( [id://1214996]=perlquestion: print w/replies, xml ) | Need Help?? |
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 ?
Back to
Seekers of Perl Wisdom
|
|