A server I administer is being pounded with a poorly coded AWS-built bot that switches IPs constantly and appears to be stuck in a recursive encoding loop. The only consistent fingerprint I can see is that each request is only a HEAD
request and each request appears to re-encode the previous one. So http://someurl.com/?foo=%25bar
becomes ..%2525..
becomes ..%252525..
... %2525252525252525...x1000
.
Here's an example of the types of requests I see:
HEAD http://example.com/?foo=%25bar
HEAD http://example.com/?foo=%2525bar
HEAD http://example.com/?foo=%252525bar
HEAD http://example.com/?foo=%25252525bar
HEAD http://example.com/?foo=%2525252525bar
HEAD http://example.com/?foo=%2525252525...25bar (x1000)
So far I've been using Cloudflare firewalls to block each IP, but they keep switching IPs.
How can I simply block all HEAD requests containing a substring (say %25252525
)?
I'm running Apache/2.4.6 (CentOS)
.