下图是单lastb命令显示出来的内容(就是说试着用哪个用户登录的)
下图是lastb -a显示出来的内容(就是说试着用哪个用户登录的,而且带“对方”的IP)
网站后门检测:
https://www.wn789.com/23561.html
vim error_login.sh
#!/bin/bash
echo "以下是试着登录过`curl ifconfig.me`的" >>试着登录IP.txt
egrep "Invalid|Failed" /var/log/secure-20190121|awk -F "from" '{print $2}'|awk -F " " '{print $1}'|sort|uniq >>~/1.txt
for i in `cat ~/1.txt`
do
TIME=`grep $i /var/log/secure-20190121|awk -F " " '{print $1,$2,$3}'|tail -1`
echo "$TIME `curl https://ip.cn/index.php?ip=$i`">>试着登录IP.txt
rm -rf ~/1.txt
done