在 Debian 系统上发生 exploit(漏洞利用/入侵) 时,应急响应要遵循 “止损 → 取证 → 清除 → 恢复 → 复盘” 的原则。下面是一套可操作的 Debian 应急响应流程。
ip link set eth0 down
# 或云环境直接安全组隔离
passwd -l username
systemctl stop suspicious_service
who
w
ps auxf
top
ss -antup
netstat -antup
关注:
cat /etc/passwd
cat /etc/shadow
last
lastlog
检查:
crontab -l
ls -la /etc/cron.*
cat /etc/crontab
systemctl list-unit-files
ls -la /etc/init.d/
尽量使用 静态二进制工具(如 busybox)防止被篡改
dpkg -V
检查被修改的系统文件
find / -mtime -3 -type f
grep -R "eval(" /var/www 2>/dev/null
/var/log/auth.log
/var/log/syslog
journalctl -xe
关注:
apt install lime-forensics
# 或使用 Volatility(需内存 dump)
rm -rf /path/to/malware
userdel -r attacker
crontab -r
systemctl disable malicious.service
apt update
apt upgrade
并:
PermitRootLogin no
PasswordAuthentication no
使用密钥登录
ufw enable
ufw deny from bad_ip
| 场景 | 常见原因 |
|---|---|
| 提权 | sudo / polkit / 内核漏洞 |
| 挖矿 | Redis / Docker 未授权 |
| webshell | 上传漏洞 / 反序列化 |
| 横向移动 | SSH 弱口令 |
如果你愿意,可以告诉我:
cat /etc/debian_version)我可以帮你做 针对性应急分析。