I'm trying to configure a regex for fail2ban for apache2 access.log.
If I browse to "https://mywebsite.com/%69%6E%64%65%78.%68%74%6D%6C" in brings me to the index.html page and this is ok. This happens server-side because in the access.log this line is being saved: "GET /%69%6E%64%65%78.%68%74%6D%6C HTTP/2.0" 200 270 "-".
The problem is that this test check fails:
sudo fail2ban-regex -vvv '1.1.1.1 /%69%6E%64%65%78.%68%74%6D%6C' '<HOST>.*index' --print-all-matched --print-no-missed --print-no-ignored
So my question is: how to catch these encoded urls? Or maybe there is a way to prevent browsing any encoded urls at all by returning a 404 error instead?
My aim is to increase the security of my server by adding a fail2ban rule for hacking attempts pointing to some specific dirs.
Thanks