rkhunter(Rootkit Hunter)是一款开源的系统安全检测工具,核心原理是:
- 对比系统关键文件 / 命令的哈希值(与官方基准值),检测是否被篡改;
- 扫描已知 Rootkit、恶意软件的特征码;
- 检查异常网络端口、可疑进程、系统配置篡改等风险点;
- 支持 “专项检测” 和 “全量检测”,你提供的命令都是专项检测(仅检测指定模块)。
前提条件:需先安装 rkhunter(CentOS/RHEL:yum install -y rkhunter;Debian/Ubuntu:apt install -y rkhunter),且建议先更新特征库:rkhunter --update。
自动化检测脚本:
#!/bin/bash
# 一键执行 rkhunter 专项检测
echo "===== 开始检测网络风险 ====="
rkhunter -sk -c --nocolor --nolog --nomow --enable network
echo -e "\n===== 开始检测 Rootkit ====="
rkhunter -sk -c --nocolor --nolog --nomow --enable rootkits
echo -e "\n===== 开始检测系统命令完整性 ====="
rkhunter -sk -c --nocolor --nolog --nomow --enable properties
echo -e "\n===== 开始检测特洛伊木马 ====="
rkhunter -sk -c --enable malware --nocolor --nolog --nomow
echo -e "\n===== 检测完成!异常信息已在终端输出 ====="
Categories:
系统运维