Answer the question
In order to leave comments, you need to log in
How to block ip addresses requesting certain php scripts?
Good day. :)
Bots periodically send requests to sites that are on vds. And to the files that I do not have on the server. For example witionlinen.php, phpinfo.php etc. Can I configure the system in such a way that all ip addresses that request such files immediately get banned (along with the /24 mask) ?. On vds there is a VestaCp panel. By default, it has fail2ban, iptables software. If it is possible to do so, then share the algorithm of actions or a link to the manual :)
Thank you very much!
Answer the question
In order to leave comments, you need to log in
Here fail2ban is what you need. Create a "prison" with a description of exactly your problem (regular season is used there) and he will ban according to this rule.
If nginx, then make sure that the ngx_http_access_module module is enabled
and further on locations, such as
Location /phpinfo.php {
deny "Evil hacker ip"
}
If apache, then
Order Deny,Allow
Deny from "Evil hacker ip"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question