我正在尝试使用这个解决方案。
我正在运行 Centos 7 和 iptables v1.4.21。
为什么我需要它? 我有几个 WordPress 博客。我每天都会收到 4000 到 20000 次暴力登录、不存在的文件,以及自动尝试查找易受攻击的插件和文件以供以后利用。他们都来自中国。其他国家也有,但每天不到1000个。因此,我想在安全性方面提供一点帮助,并在这些请求到达 Web 服务器或 PHP 引擎之前阻止这些请求,以节省硬件资源。我考虑过在 Security StackExchange 上提出问题,但我认为这里更好。但不知道。我想避免重复的问题。
我的脚本如下所示:
# Create the ipset list
ipset -N china hash:net
# remove any old list that might exist from previous runs of this script
rm cn.zone
# Pull the latest IP set for China
wget -P . http://www.ipdeny.com/ipblocks/data/countries/cn.zone
# Add each IP address from the downloaded list into the ipset 'china'
for i in $(cat /etc/cn.zone …Run Code Online (Sandbox Code Playgroud)