WordPress and Login Security Solution - SQL query

Login Security Solution is a very useful plugin if you want to slow down brute force attacks, enforce password policies and timeout inactive sessions. It is also worth mentioning that it records the IP address of every failed login attempt so it is easy to integrate with your own solutions such as htaccess deny directive.

To display top ten offending IP addresses for the current month execute SQL query:

SELECT ip,
       COUNT(ip) AS COUNT
FROM  wp_login_security_solution_fail
WHERE YEAR(date_failed)  = YEAR(CURDATE())
  AND MONTH(date_failed) = MONTH(CURDATE())
GROUP BY ip
ORDER BY COUNT DESC LIMIT 10

login_security_solution

Modify the above SQL query to get something more specific than just a number of failed login attempts for current month grouped by IP address so you can use the obtained data to update htaccess file using deny directive or anything else that comes to your mind.

Milosz Galazka's Picture

About Milosz Galazka

Milosz is a system administrator working for a successful Polish company and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu