更新时间: 2021/04/19
更新时间: 2021/01/20
mikrotik导入例子/imp scaners.rsc
linux(纯iptables模式)导入例子 iptables-restore < scaners.bak
linux(ipset模式)导入例子 ipset restore -f < scaners.bak
ipset模式使用提醒
1.需要安装好ipset程序(apt-get install ipset)
2.新建好scaners地址表(ipset -N scaners iphash)
3.设置iptables调用(iptables -A INPUT -m set --match-set scaners src -j DROP)
netbsd(npf模式)模式使用提醒
1.需要安装好npf防火墙程序
2.安装wget程序
3.设置npf调用
- table <blocklist> type lpm file "/etc/npf_blocklist"
- group "block_rule" {
- block in final from <blocklist> to any
- }
- ###若需要加载到FLASH则注释掉下行代码,若需要加载到RAM则反之。###
- #:global ipt 30d
- :global upc
- :local getscaner [/tool fetch url="https://pcdn.ros6.com:9443/oss/scaners.rsc" dst-path=scaners.rsc check-certificate=yes as-value]
- :if ($getscaner->"status" = "finished") do={
- /ip firewall address-list remove [find list="scaners"]
- :delay 2s
- /imp scaners.rsc
- :delay 5s
- /file remove [find name="scaners.rsc"]
- :log warning "扫描者黑名单更新完成"
- :set upc (upc+1)
- }
- :if (upc > 15) do={
- :local getssl [/tool fetch url="https://pcdn.ros6.com:9443/oss/cmp_cert.crt" dst-path=cmp.crt check-certificate=yes as-value]
- :if ($getssl->"status" = "finished") do={
- :delay 2s;
- /certificate import file-name=cmp.crt name=cmp passphrase="";
- :delay 1s;
- /file remove [find name="cmp.crt"];
- :log warning "SSL本地证书更新完成"
- :set upc 0
- }
- }
- #!/bin/sh
- PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin
- wget -q -O /root/upfw.bak https://pcdn.ros6.com:9443/oss/scaners.bak || {
- echo "Error: Failed to download list."
- exit 1
- }
- sleep 10s
- iptables -F
- sleep 5s
- iptables-restore </root/upfw.bak
- sleep 5s
- rm /root/upfw.bak
- #!/bin/sh
- PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin
- wget -q -O /root/upipset.bak https://pcdn.ros6.com:9443/oss/scaners2.bak || {
- echo "Error: Failed to download list."
- exit 1
- }
- sleep 10s
- ipset flush scaners
- sleep 5s
- ipset restore -f /root/upipset.bak
- sleep 5s
- rm /root/upipset.bak
- #!/bin/sh
- PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin
- wget --no-check-certificate -q -O /etc/npf_blocklist https://pcdn.ros6.com:9443/oss/scaners.netbsd || {
- echo "Error: Failed to download list."
- exit 1
- }
- sleep 10
- npfctl reload
mikrotik设备(import导入):https://cache-1.oss-cn-beijing.aliyuncs.com/file/scaners.rsc
linux设备(iptables-restore导入):https://cache-1.oss-cn-beijing.aliyuncs.com/file/scaners.bak
linux设备(ipset导入):https://cache-1.oss-cn-beijing.aliyuncs.com/file/scaners2.bak