家里老人用云视听极光看电视(长虹无法 root 的老机型),腾讯的广告真是丧心病狂,广告都是七八十秒起步,偶尔会有 500+的,各种理财课程的割韭菜广告,辣耳朵!
路由器刷的 OpenWrt ,广告插件用的是 DNSfilter ,搜了几个广告规则没啥效果,似乎云视听极光的广告尤其难搞。
通过路由器抓包分析,广告视频链接如下格式:
http://sv-video.play.t002.ottcn.com/playlist.m3u8?vids=w3715yeyz3p|w3728l84yj1&sdtfrom_list=v8256|v8256&speed=&dtype=1&defn=&platform= 将域名sv-video.play.t002.ottcn.com加入 DNSfilter 黑名单测试,没有效果! 进一步分析发现有这样的请求数据:
http://182.254.116.116/d?dn=sv-video.play.t002.ottcn.com&ttl=1 这是用 HTTP 请求代替了本地的 DNS 请求,发现还有类似的其它几个域名解析 HTTP 请求,是用来播放正常视频的域名 所以不能直接把 IP182.254.116.116加入黑名单了事
接着就想到用防火墙规则来搞,目标地址:182.254.116.116,关键字:sv-video.play 谷歌了一下,拼凑出了下面的规则:
iptables -A OUTPUT -d 182.254.116.116 -m string --string "sv-video.play" --algo bm -j DROP reload 防火墙后测试,依旧没有效果
请大侠指点
附上 iptables --list 回显信息:
[root@OpenWrt:16:27 ~] # iptables --list # Warning: iptables-legacy tables present, use iptables-legacy to see them Chain INPUT (policy ACCEPT) target prot opt source destinaton Chain FORWARD (policy ACCEPT) target prot opt source destination DROP all -- anywhere anywhere match-set blockip dst /* _DNSFILTER_RULE_ */ ACCEPT all -- anywhere anywhere ... Chain OUTPUT (policy ACCEPT) target prot opt source destination DROP all -- anywhere anywhere match-set blockip dst /* _DNSFILTER_RULE_ */ DROP all -- anywhere 182.254.116.116 STRING match "sv-video.play" ALGO name bm TO 65535 
