Block a slimeball who requests /plugins/foo or /themes/foo and ‘foo’ isn’t installed!
I can’t think of a single reason for a non-logged-in user to request a URL for a plugin that isn’t installed. There’s no doubt that someone doing this is probing the site for vulnerabilities, looking for a vector into the system for malicious activity.
So rather than forcing an admin to look at logs for invalid requests, Defender should do it.
This can be handled quickly in at least three ways:
1. On 404, does the URL include /plugins/ or /themes/ ? If so, is that plugin or theme installed? If not, they’re probing! Block them on the first attempt.
2.What hooks are executed in this area? We can code our own tests.
3. (The fast but difficult way) : Allow the blocklist to include complex regex. This should be in there anyway. With this we can code one or more patterns that include ‘/plugins/’ or ‘/themes/’ And does Not include all of the plugins that we manually list and update every time we change plugins. (Ugh)
Really, let’s keep it simple, just tell us how to hook a 404 and return a True to ban the IP. That addresses every such request from now until DEV enhances this area.
There are other things that we and others might want to ban and it makes no sense to ask DEV to make a custom enhancement for every purpose – it’ll never happen, so let’s not complicate it, just make it easy for us to code our own solutions. For example, if we see that people are trying to hack pages or plugins that we do have, we shouldn’t need to ask DEV for new mechanisms to address that. We should be able to do what we need, fast, efficiently, without coming back here.
(Translation: Don’t offer us fish, make it easy for us to fish for ourselves.)
BTW, we use fail2ban for things like this anyway – with a great platform like Defender we shouldn’t need to do that.
Thanks.