Bruteforce (DDOS) attacks prevention and monitoring

Posted November 9, 2019 1.2k views


I’m working on a username/password protected system and I have login.php file that accepts username and password pair over https and just responds with with an error code or success code.

Question: how to monitor if someone started a bruteforce attack on my login.php script (assuming they are making a lot of requests to it) and how to block them from doing that?

Thank you!

edited by fcasas

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I would recommend adding a captcha to the login page, that way you would stop most of the bots from brute-forcing the login page.

Also, you could check your Nginx or Apache access logs in order to identify if there are any suspicious numbers of requests to the login page. You could have a look at this script which would summarize the access logs for you.

Hope that this helps!