Linux应急响应

查看登录历史记录
last
aulast
查看所有⽤户的最后登录记录
aulastlog
查看命令历史记录
history
cat ~/.bash_history
查看当前可登录的⽤户列表
cat /etc/passwd|grep -v “^\s*#”|grep -E -v
“/sbin/nologin|/bin/sync|/sbin/shutdown|/sbin/halt|/bin/false”|awk
-F ‘:’ ‘{print $1}’
查看当前所有的定时任务
for u in cat /etc/passwd|grep -v "^\s*#"|grep -E -v "/sbin/nologin|/bin/sync|/sbin/shutdown|/sbin/halt|/bin/false"|awk -F ':' '{print $1}'
do
crontab -u $u -l
done
查看ssh爆破记录(登录失败与登录成功)
#统计出现多少次登陆失败
cat /var/log/secure|grep " sshd"|grep “Failed password”|grep -E -o
“([^ ]+) from ([^ ]+) port”|awk ‘{print $1" "$3}’|sort -n|uniq -c|
sort -n -t 1 -r
#统计出现多少次登陆成功
cat /var/log/secure|grep ” sshd“|grep “Accepted password”|grep -E
-o “([^ ]+) from ([^ ]+) port”|awk ‘{print $1" "$3}’|sort -n|uniq -
c|sort -n -t 1 -r
查看⾃动启动配置
#备注:使⽤systemctl启动的话,需要检查rc-local服务是否启⽤,如⽆启⽤则⽆⾃动
启动配置
systemctl status rc-local
cat /etc/rc.local
1查看服务
chkconfig --list
systemctl list-unit-files|grep enabled
查看进程
ps axjf
查看登陆⽤户列表
w
注销⽤户
pkill -kill -t
#例⼦:pkill -kill -t pts/0
查看⽹络连接
#tcp⽹络连接
netstat -antlp
ss -atpnl
#udp⽹络连接
netstat -anulp
ss -aupnl
查看隐藏仅进程
str_pids="ps -A | awk '{print $1}'";
for i in /proc/[[:digit:]]*;
do
if echo “ s t r p i d s " ∣ g r e p − q s ‘ b a s e n a m e " str_pids" | grep -qs `basename " strpids"grepqsbasename"i”`;
then
:
else
echo “Rootkit’s PID: ( b a s e n a m e " (basename " (basename"i”)";
fi
done
安装程序历史
cat /var/log/yum.log
2任务计划历史
cat /var/log/cron
启动记录
cat /var/log/boot.log
审计配置
auditctl -l
审计记录(命令执⾏记录)
cat /var/log/audit/audit.log|grep EXECVE
#查看所有关于root的审计记录
ausearch -ui root
查找特权⽂件
find -type f / -print|xargs ls -l|grep -E “^-[r-][w-](s|[Sx-][r-]
w-)”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值