Created
November 8, 2018 07:33
-
-
Save christophlehmann/df3b7527602b7173a12c97ea8c67a03a to your computer and use it in GitHub Desktop.
Apache log fail2ban sql injection scanner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Definition] | |
| failregex = ^<HOST> .*UNION%%20SELECT%%20CHAR.*HTTP | |
| ^<HOST> .*select\*from.*HTTP | |
| ^<HOST> .*select%%20name_const.*HTTP | |
| # Dev notes | |
| # | |
| # % must be escaped with '%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [sql-scanner] | |
| enabled = true | |
| port = http,https | |
| maxretry = 2 | |
| bantime = 3600 | |
| logpath = /home/*/logs/access.log | |
| action = %(action_mwl)s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. Thank you for the example et @AcckiyGerman thank you for your improvement.
I found that
.*select.*fromcan be too large and can match legitimate lines. For example :Also I am adding a way to catch injections in the referrer, because I have seen attacks with SQL injections in referrer.
And I am adding an ignoreregex to ignore phpmyadmin and pgadmin.