报告时间: 2026-08-13 13:00 (UTC+8) · 主机: OpenCloudOS 9.4 (Tencent Cloud CVM) · 报告人: 自动化安全处置 agent (配合管理员操作)
该服务器曾于 2026-07-27 被入侵,攻击者植入了多层自愈型 SSH 后门/rootkit(五副本 + XOR 伪装 bootstrap + 10 秒级 systemd 定时器 + cron 看门狗),并通过泄露的 openclaw 凭据实现远程操控。经过 2026-08-13 一轮排查与处置和两轮复核,恶意组件已 100% 清除,服务器重启后无自愈复活,攻击者自 8-12 23:39 后未再出现。当前系统处于"恶意残留清零"状态,但仍存在若干暴露面风险(非恶意残留),需按第 7 节逐项加固。
入侵入口: openclaw-gateway 的 QQ 机器人通道。
openclaw-gateway( v2026.3.8 ,root 用户 systemd user 服务)通过 QQ 机器人通道( wss://api.sgroup.qq.com, appId 1903352658 )暴露了 operator 权限的 agent 执行能力——任何人能通过该机器人向服务器下达执行命令,等效于远程命令执行( RCE )。clientSecret / gateway token / ikun apiKey 以明文存放在 /root/.openclaw/openclaw.json 中;/root/.bash_profile 中还有明文 ANTHROPIC_AUTH_TOKEN。useradd ops 并重启 sshd —— 与 openclaw 通道可静默执行命令的能力完全吻合,且该通道不需要 SSH 会话。openclaw 即入侵执行链的入口。| 时间 (UTC+8) | 事件 |
|---|---|
| 2026-07-27 03:02 | 入侵首现:无前置 SSH 登录情况下执行 useradd ops(UID 1001)、写入 sshd 恶意配置、sshd 重启。攻击者此时已持有 root 权限(经 openclaw 通道) |
| 2026-07-27 03:02 起 | 恶意组件上线:ssh-healthcheck.timer 每 2 分钟探测 22 端口;五副本 guard 二进制 + XOR bootstrap + 10 秒级 systemd-session-cleanup.timer 自愈环 |
| 2026-07-27 03:04 起 | 恶意 cron */2 * * * * /usr/lib/systemd/systemd-session-helper 每 2 分钟执行(产生 219MB cron 日志) |
| 2026-07-27 03:11 | 攻击者密钥首次 SSH 登录 root ,来源 112.47.200.247 |
| 2026-07-27 14:41–15:44 | 同密钥从 112.47.200.247 密集登录(数十会话) |
| 2026-07-28 04:42–05:12 | 同密钥从 188.253.126.64 登录 |
| 2026-07-28 21:04 | 同密钥从 112.47.201.137 登录 |
| 2026-08-07 17:18 / 17:31 | 同密钥从 188.253.126.62 登录 |
| 2026-08-12 23:39 | 同密钥从 188.253.126.63 登录 —— 攻击者最后一次活动 |
| 2026-08-13 11:37–12:08 | 管理员与处置 agent 联合清理:删 ops 账户、改 root 密码、执行 cleanup.sh 、删除全部恶意文件、12:08 重启服务器 |
| 2026-08-13 12:10–12:45 | 深度复查:清除 3 处遗漏残留;定位入侵源头 openclaw 并彻底移除其组件与明文凭据 |
| 2026-08-13 12:55–13:00 | 终检复查:移除全部备份/样本;全系统风险复查通过(本报告) |
攻击者密钥指纹: ED25519 SHA256:JfUkBNTLQgu+LM2ya/ZHxEGuH2Qq1UY3/0OkzT0/WPo
攻击者 IP: 112.47.200.247 / 112.47.201.137 (国内跳板)、188.253.126.62/.63/.64 (境外 VPS 段)
| 类别 | 路径 | 状态 |
|---|---|---|
| 主后门二进制 | /usr/lib/systemd/systemd-session-helper |
✅ 已删 |
| 副本 2–5 | /usr/lib/.sessiond、/usr/share/doc/base-files/.helper、/usr/share/locale/.lang-data、/var/lib/guard/.guard-self |
✅ 已删 |
| XOR 伪装 bootstrap | /usr/lib/locale/.locale-archive.bak |
✅ 已删 |
| 自愈 wrapper | /usr/lib/.systemd-cgroup-helpers.sh |
✅ 已删 |
| 伪装健康检查 | /usr/local/sbin/ssh-healthcheck.sh |
✅ 已删 |
| 恶意定时器/服务 | systemd-session-cleanup.{service,timer}、ssh-healthcheck.{service,timer} |
✅ 已删 |
| 自愈 drop-in | sshd.service.d/guard-restart.conf、ssh.service.d/guard-restart.conf |
✅ 已删 |
| 密钥后门配置 | sshd_config.d/60-cloudimg-settings.conf、99-local-users.conf、70-guard-hardening.conf |
✅ 已删 |
| SSH 后门 | /root/.ssh/rc、/root/.ssh/authorized_keys(攻击者公钥)、/usr/share/doc/base-files/.c、.ops、/home/ops/.ssh/authorized_keys |
✅ 已删( authorized_keys 现为空且 chattr +i 冻结) |
| 后门账户 | ops(UID 1001) 及 /etc/sudoers.d/ops |
✅ 已删 |
| cron 看门狗 | root crontab 中 systemd-session-helper 行 |
✅ 已删 |
| 状态目录 | /var/lib/guard/ |
✅ 已删 |
| 入侵源头 | openclaw-gateway 服务、/root/.openclaw/(含明文凭据)、/tmp/openclaw*、fnm 下 openclaw 包 |
✅ 已删 |
按"先断触发器 → 杀进程 → 清文件 → 删单元 → 删后门 → 删账户 → SSH 加固 → 复查"的顺序执行:
pkill -9 终止 guard 进程与 wrapperchattr +i 冻结)/root/.bash_profile 中泄露的 ANTHROPIC_AUTH_TOKENPermitRootLogin prohibit-password( sshd -t 通过并重启)彻底终止可能在内存中的 guard 进程,验证自愈机制是否复活 → 无复活迹象。
逐面排查 20+ 项(账户/认证、cron 、systemd 单元、rc.local/profile/ld 、SSH 配置、SUID/隐藏文件、/tmp 、进程、网络连接、内核模块、登录日志、Docker 、面板),发现并清除 3 处 cleanup.sh 遗漏的残留:
/etc/systemd/system/ssh.service.d/guard-restart.conf( Birth 2026-07-27 03:02 ,Restart=always 自愈 drop-in )/etc/ssh/sshd_config.d/60-cloudimg-settings.conf(伪装 cloudimg 的密钥后门配置,与 useradd ops 同一分钟写入)/root/.openclaw(含 openclaw.json 明文凭据及 5 个 .bak )、/tmp/openclaw*、fnm 下 openclaw 包/root/.bash_profile.bak.leaked。仅保留文字报告。| 排查面 | 结果 |
|---|---|
| 恶意进程 | ✅ 无( pgrep 精确复查通过) |
| 恶意文件/目录 | ✅ 全部 GONE (含 /var/lib/guard 、/root/guard_new ) |
| systemd 定时器/单元 | ✅ 无恶意项; enabled 列表均为发行版/腾讯云/用户服务 |
| cron | ✅ root crontab 仅剩腾讯云 stargate 行; cron.d 均为标准项 |
| SSH 后门 | ✅ /root/.ssh/rc GONE ; authorized_keys 空( chattr +i 冻结); sshd_config.d 仅剩发行版标准文件; ssh.service.d GONE |
| SSH 配置 | ✅ PermitRootLogin prohibit-password |
| 账户/sudo | ✅ ops 不存在; sudoers.d 仅 cloud-init 标准项;唯一 UID0 为 root |
| 攻击者活动 | ✅ 8-13 全天无攻击者 IP ( 112.47.x / 188.253.126.x )任何登录或尝试 |
| 今日成功登录 | ✅ 仅 root 系统会话与管理员 lighthouse 会话 |
| openclaw 残留 | ✅ 无进程 / 端口未监听 / 文件 GONE |
| 防火墙 | ✅ firewalld 已启用( public zone 管理 eth0 ) |
| x-ui / s-ui | ✅ 均已停用,5002/2096 不再监听 |
| Docker 容器 | ✅ 6 容器均无 privileged/危险 capability (存在挂载问题,见 §7.3 ) |
| 泄露 token 盗用痕迹 | ✅ 系统日志中无任何使用痕迹(仍须外部吊销,见 §7.1 ) |
sk-gyDPfq...(泄露窗口自 2025-09-28 起,虽无盗用痕迹但必须吊销)1Panel-postgresql 映射 0.0.0.0:5432,docker 的 DNAT/FORWARD 链绕过 firewalld public zone ( DOCKER-USER 链为全放行),5432 很可能公网可达。建议改为 127.0.0.1:5432 或加防火墙规则。/opt/1panel/apps/openlist/openlist/data/files:/root:rw,可写)——该容器一旦被攻破即可读写宿主机 root 目录。强烈建议移除该挂载。/root/.ssh/authorized_keys 仍被 chattr +i 冻结——管理员添加自己公钥前需先执行 chattr -i /root/.ssh/authorized_keys,加完可再冻结。~/secure/reasonix.toml 中 bash="off" + allow_write=["/"] 是入侵处置期间为获得全盘写权限而放宽的,处置已结束,建议恢复默认沙箱( allow_write 收窄、bash 恢复 enforce )以降低 agent 通道被滥用时的风险。/root/secure/INCIDENT_REPORT.md(首轮入侵调查报告)/root/secure/forensics/deep-audit-2026-08-13.md(深度复查报告)/root/secure/forensics/openclaw-cleanup-20260813.md(源头清理记录)/root/secure/cleanup.sh 与 /root/secure/cleanup-run-1.log(清理脚本及执行日志)/root/secure/FINAL_SECURITY_REPORT.md/var/log/secure 保留了攻击者全部登录记录(密钥指纹、来源 IP 、时间),可随时提取佐证。这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.