qinglong icon indicating copy to clipboard operation
qinglong copied to clipboard

支持关闭 匿名数据上报,避免大量的sentry.io DNS请求

Open zqbake opened this issue 3 years ago • 2 comments

Qinglong version

1.33.0

Steps to reproduce

正常使用青龙,使用adguardhome 禁止sentry相关请求,查看dns请求数量 image

What is expected?

减少sentry DNS请求频率,或者增加选项关闭 用户数据上报。

What is actually happening?

1分钟产生十几次sentry DNS请求

image

System Info

No response

Any additional comments?

No response

zqbake avatar Sep 14 '23 10:09 zqbake

0x00

在RouterOS配置防火墙时,发现羊毛机docker有奇怪的invalid流量被drop,乍一看还以为成了DDOS肉鸽:

forward: in:bridge(ether2) out:bridge(ether1), src-mac xx:xx:xx:xx:xx:xx, proto TCP (ACK,FIN,PSH), 192.168.xxx.xxx:42326->34.120.195.249:443, len 435 forward: in:bridge(ether2) out:bridge(ether1), src-mac xx:xx:xx:xx:xx:xx, proto TCP (ACK,FIN,PSH), 192.168..xxx.xxx:42326->34.120.195.249:443, len 435

0x01

sudo nethogs -a进行检查,可以发现包来自qinglong的docker内网ip,以约1pack/s的速度与34.120.195.249:443收发包

NetHogs version 0.8.5-2 PID USER PROGRAM DEV SENT RECEIVED
? root 172.17.0.4:39268-34.120.195.249:443 0.000 0.103 KB/sec
? root 34.120.195.249:443-172.17.0.4:39208 0.000 1.425 KB/sec
? root 172.17.0.4:39282-34.120.195.249:443 0.000 0.029 KB/sec ? root 192.168.xxx.xxx:39282-34.120.195.249:443 0.290 0.014 KB/sec ? root 192.168.xxx.xxx:38140-34.120.195.249:443 0.000 0.000 KB/sec ? root 172.17.0.4:39254-34.120.195.249:443 0.000 0.000 KB/sec ? root 192.168.xxx.xxx:39254-34.120.195.249:443 0.088 0.000 KB/sec ? root 192.168.xxx.xxx:39200-34.120.195.249:443 0.088 0.000 KB/sec ? root 172.17.0.4:39246-34.120.195.249:443 0.000 0.000 KB/sec ? root 192.168.xxx.xxx:39246-34.120.195.249:443 0.088 0.000 KB/sec ? root 192.168.xxx.xxx:39208-34.120.195.249:443 0.000 0.000 KB/sec ? root unknown TCP 0.000 0.000 KB/sec TOTAL

0x02

用sudo tcpdump -i eth0 -n -vnn dst host 34.120.195.249 -w qinglong.cap 进行抓包,发现数据TLS加密了,但可以看到server_name,遂在github搜索到此issue。

Extension: server_name (len=30) name=o1098464.ingest.sentry.io

0x03

屏蔽方法:羊毛机iptables添加三条规则,屏蔽上报服务器IP,并且屏蔽其sentry.io域名:

sudo iptables -I DOCKER-USER -p all -s 34.120.195.249 -j DROP sudo iptables -I DOCKER-USER -p all -d 34.120.195.249 -j DROP sudo iptables -A DOCKER-USER -m string --string "sentry.io" --algo bm --to 65535 -j DROP

添加后再次用tcpdump抓包,可见已无上报。

GImDX avatar Jan 23 '24 21:01 GImDX

docker exec $(CONTAINER_ID) sed -i '/Sentry.init/ s/^/return;/' /ql/static/build/loaders/sentry.js 将 $(CONTAINER_ID) 更改为你的青龙容器ID,在控制台运行这段命令,然后重启容器 别人分享的方法,实测可用

EverRise6 avatar Jun 12 '24 18:06 EverRise6