运维安全之入侵检测

  入侵检测

  •   本地平台检测方法
  •   云平台检测方法

  查看系统日志

  查看安全相关日志

  ssh远程登录失败日志

 #grep -i Failed /var/log/secure

   ssh远程登录成功日志

# grep -i Accepted /var/log/secure

   统计登录成功或登录失败的ip,并进行去重降序排列

#grep -i Accepted /var/log/secure |awk '{print $(NF-3)}' |grep '^[0-9]' |sort |uniq -c

   查看指定时间之前登录信息

[root@localhost ~]# last -a -t 20190210123030
#2019-02-10 12:30:30之前

   查看记录每个用户最后的登入信息

lastlog

 

   统计当前在线状态

w

 

   

  查看异常流量

  iftop 动态查看网卡接口流量

[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install iftop
[root@localhost ~]# iftop -i eth0

 

   

  数据包抓取

  wireshark,tcpdump,sniffer

  tcpdump

  基本用法

# tcpdump -i eth0 -nnv
# tcpdump -i eth0 -nnv -c 100
# tcpdump -i eth0 -nnv -w /file1.tcpdump
# tcpdump -nnv -r /file1.tcpdump

   

原文地址:https://www.cnblogs.com/minseo/p/13653060.html