屏蔽 Censys 的 IP 段
sudo ufw insert 1 deny from 162.142.125.0/24 to any
sudo ufw insert 1 deny from 167.94.138.0/24 to any
sudo ufw insert 1 deny from 167.94.145.0/24 to any
sudo ufw insert 1 deny from 167.94.146.0/24 to any
sudo ufw insert 1 deny from 167.248.133.0/24 to any
sudo ufw insert 1 deny from 199.45.154.0/24 to any
sudo ufw insert 1 deny from 199.45.155.0/24 to any
sudo ufw insert 1 deny from 206.168.34.0/24 to any
v6单独添加,首先查看编号
sudo ufw status numbered
再把以下插入到v6最上方,假设最上方的v6编号是20
sudo ufw insert 20 deny from 2602:80d:1000:b0cc:e::/80
sudo ufw insert 21 deny from 2620:96:e000:b0cc:e::/80
sudo ufw insert 22 deny from 2602:80d:1003::/112
sudo ufw insert 23 deny from 2602:80d:1004::/112
sudo ufw insert 24 deny from 2620:0:1c00::/40
sudo ufw insert 25 deny from 2a03:2880::/32
sudo ufw insert 26 deny from 2a03:2880:fffe::/48
sudo ufw insert 27 deny from 2a03:2880:ffff::/48
sudo ufw insert 28 deny from 2620:0:1cff::/48
屏蔽单独的风险IP地址
sudo ufw insert 1 deny from 94.154.33.153 to any
sudo ufw insert 1 deny from 185.220.101.29 to any
sudo ufw insert 1 deny from 138.197.191.87 to any
sudo ufw insert 1 deny from 152.42.217.201 to any
sudo ufw insert 1 deny from 149.88.106.138 to any
sudo ufw insert 1 deny from 179.43.191.19 to any
sudo ufw insert 1 deny from 146.190.111.4 to any
sudo ufw insert 1 deny from 185.220.101.190 to any
sudo ufw insert 1 deny from 192.42.116.178 to any
屏蔽IP范围
包含一些垃圾IDC疯狂扫描的情况
sudo ufw insert 1 deny from 20.171.206.0/24 to any
sudo ufw insert 1 deny from 52.230.152.0/24 to any
sudo ufw insert 1 deny from 52.233.106.0/24 to any
sudo ufw insert 1 deny from 152.32.128.0/17 to any
sudo ufw insert 1 deny from 103.218.243.0/24 to any
屏蔽facebook爬虫
sudo ufw insert 1 deny from 69.63.176.0/21 to any
sudo ufw insert 1 deny from 69.63.184.0/21 to any
sudo ufw insert 1 deny from 66.220.144.0/20 to any
sudo ufw insert 1 deny from 69.63.176.0/20 to any
屏蔽SemrushBot
sudo ufw insert 1 deny from 85.208.96.0/24 to any
sudo ufw insert 1 deny from 185.191.171.0/24 to any
重新加载UFW生效
sudo ufw reload
查看规则
sudo ufw status numbered
清空所有屏蔽
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/clear_ufw_rules.sh && chmod +x clear_ufw_rules.sh && ./clear_ufw_rules.sh