Files
.pouch/skills/host-sec-check/references/persistence.md
T
2026-09-04 11:54:07 +08:00

41 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 持久化位置
按这个名单扫。出现「刚被排查时时间戳又刷新」= 仍有 watchdog。
## 定时
- `crontab -u root -l` 以及 `/var/spool/cron/crontabs/*`
- `/etc/cron.d/` `/etc/cron.hourly/` `/etc/cron.daily/` `/etc/cron.weekly/`
- systemd timers:`systemctl list-timers --all`
## 服务
- `/etc/systemd/system/*.service`(尤其非发行版默认的)
- `ExecStart` 指向 `/tmp`、`/dev/shm`、`/root/.config`、随机短名
- `Restart=always` 的陌生服务
## 动态链接器
- `/etc/ld.so.preload`:内容常是 `/lib/libXXX.so`(约十几字节)。宿主机 `cat` 可能显示空,用容器 hexdump
- 对应 `.so` 可能 `chattr +i`、setgid
- 常见名:`libgcwrap.so`、`libpprocps.so`、`libfsnldev.so`、`libprocesshider.so`
## 二进制与分身
- `/usr/bin` `/bin` `/usr/local/bin` `/tmp` 下刚改过的可执行文件
- 同字节大小的多份拷贝(矿机改名)
- 占位对抗:空文件 `chmod 000` + `chattr +i`(见 cleanup.md)
## 隐藏运行时
- 第二套 dockerd:`--data-root` 不在 `/var/lib/docker`,`--host unix://` 异常路径
- 混淆文件名(把 docker 子命令拼进无关单词)
- k3s 的 `containerd-shim` 被借去跑 **moby** namespace + 异常 `--address`
## 登录与启动
- `~/.bashrc` / `/etc/profile.d` 里 curl|bash
- `/etc/rc.local`
- SSH `authorized_keys` 多出来的 key
- 意外用户、UID 0 非 root