Здравствуйте, уважаемые программисты и разработчики сайтов, а также дизайнеры и анонимы!
Боты ищут на сайте уязвимости по адресам типа xx.php, m.php, bb.php, shell.php, root.php, wp-login.php , /news/wp-includes/wlwmanifest.xml и прочие ворпрессы. Что-то, относящееся к адресам Drupal 9, на котором работает сайт, сложно найти, видимо его реже всего взламывают. Вот примерный error.log nginx
2021/09/16 09:42:28 [error] 16450#16450: *484923 access forbidden by rule, client: 141.101.76.52, server: site.com, request: "GET /wp-content/ HTTP/1.1", host: "site.com"
2021/09/16 10:59:08 [error] 16450#16450: *485803 access forbidden by rule, client: 141.101.76.94, server: site.com, request: "GET /wp-content/ HTTP/1.1", host: "site.com"
2021/09/16 12:14:54 [error] 16450#16450: *486788 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/www/x.php (No such file or directory)" while reading response header from upstream, client: 141.101.77.224, server: site.com, request: "GET /x.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.com"
2021/09/16 12:14:54 [error] 16450#16450: *486788 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/www/wso.php (No such file or directory)" while reading response header from upstream, client: 141.101.77.224, server: site.com, request: "GET /wso.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.com"
2021/09/16 12:14:55 [error] 16450#16450: *486788 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/www/srx.php (No such file or directory)" while reading response header from upstream, client: 141.101.77.224, server: site.com, request: "GET /srx.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.com"
2021/09/16 12:14:55 [error] 16450#16450: *486788 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/www/1337.php (No such file or directory)" while reading response header from upstream, client: 141.101.77.224, server: site.com, request: "GET /1337.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.com"
2021/09/16 12:14:55 [error] 16450#16450: *486788 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/www/xx.php (No such file or directory)" while reading response header from upstream, client: 141.101.77.224, server: site.com, request: "GET /xx.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.com"
Были добавлены запреты на доступ к таким адресам, но эта мера видится не достаточной:
# block wordpress bots
location ~ ^/(wordpress|wp-) {
deny all;
}
# block joomla bots
location ~ ^/(administrator) {
deny all;
}
# block drupal bots
location ~ ^/(sites/all/libraries/elfinder|sites/all/libraries/plupload) {
deny all;
}
# block other bots
location ~ ^/(old|new|oldsite|site|test|components|connectors|ckeditor|fckeditor|xmlrpc\.php|images/.*\.php) {
deny all;
}
Подскажите, есть ли способ забанить серые IP, с которых происходят такие запросы, и есть ли готовая база серых ip?
Больше всего отличились следующие ip:
$ grep -e 'forbidden by rule' -e 'No such file' error.log | grep -o 'client: [\.0-9]*' | cut -d' ' -f2 | sort | uniq -u
108.162.215.102
108.162.215.138
108.162.219.176
108.162.221.16
108.162.221.50
108.162.229.88
108.162.237.138
108.162.237.142
108.162.237.194
108.162.245.50
108.162.249.94
108.162.250.181
141.101.104.29
141.101.105.132
141.101.105.252
141.101.105.66
141.101.105.74
141.101.76.100
141.101.76.154
141.101.76.172
141.101.76.208
141.101.76.52
141.101.76.94
141.101.77.155
141.101.77.19
141.101.77.218
141.101.96.139
141.101.98.130
141.101.99.65
162.158.107.175
162.158.111.175
162.158.119.67
162.158.129.124
162.158.166.139
162.158.178.168
162.158.178.9
162.158.183.167
162.158.183.171
162.158.183.223
162.158.183.225
162.158.187.141
162.158.191.158
162.158.203.43
162.158.203.45
162.158.227.194
162.158.255.134
162.158.50.33
162.158.62.179
162.158.88.200
162.158.89.235
162.158.89.59
162.158.90.42
162.158.90.88
162.158.91.119
162.158.93.207
162.158.94.186
162.158.94.210
172.68.10.234
172.68.11.85
172.68.141.58
172.68.142.89
172.68.144.23
172.69.194.28
172.69.208.136
172.69.34.184
172.69.34.230
172.69.35.181
172.69.54.243
172.69.55.106
172.69.55.40
172.69.62.7
172.69.63.63
172.69.63.9
172.69.68.13
172.69.68.167
172.70.110.136
172.70.110.220
172.70.114.42
172.70.114.80
172.70.126.112
172.70.126.26
172.70.127.29
172.70.130.84
172.70.134.154
172.70.147.100
172.70.147.38
172.70.147.70
172.70.147.84
172.70.35.49
172.70.35.87
172.70.98.174
172.70.98.66
173.245.52.213
173.245.54.231
197.234.242.188