I
I
Ivan Kozlov2016-04-11 14:09:35
linux
Ivan Kozlov, 2016-04-11 14:09:35

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

3 answer(s)
A
Andrey, 2016-04-11
@ivnish

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.

A
Alexander, 2016-04-11
@AlexListen

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"

D
DuD, 2016-04-11
@DuD

Ready how-to
https://rtfm.co.ua/fail2ban-nastrojka-ruchnyx-filt...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question