1. 确定文件类型
可以使用file命令来检查该文件的类型,这有助于判断它是否真的是一个恶意文件
file /path/to/the/file2. 检查文件内容
使用strings命令查看文件内容,看是否有可疑的命令或脚本:
strings /path/to/the/file3. 扫描系统
使用ClamAV这样的开源杀毒软件,来扫描可疑目录 ,来清除是否还有剩余的木马或病毒文件
sudo apt update
sudo apt install clamav
sudo clamscan --recursive /path/to/the/file4. 检查隐藏文件和目录
使用lsattr和chattr命令来查看和修改文件属性,这些文件可能被设置为隐藏或不可删除:
lsattr /path/to/the/file
sudo chattr -i /path/to/the/file  # 移除immutable属性
sudo rm /path/to/the/file         # 删除文件5. 检查启动项和定时任务
查看是否有恶意脚本被添加到启动项或定时任务中:
sudo less /etc/crontab
sudo less /etc/cron.d/*
sudo less /etc/cron.hourly/*
sudo less /etc/cron.daily/*
sudo less /etc/cron.weekly/*
sudo less /etc/cron.monthly/*
sudo less /etc/init.d/*6. 对重要文件进行备份
对重要文件备份下载 ,严重时 可以考虑重新还原系统