1. 程式人生 > 實用技巧 >運維安全之入侵檢測

運維安全之入侵檢測

  入侵檢測

  •   本地平臺檢測方法
  •   雲平臺檢測方法

  檢視系統日誌

  檢視安全相關日誌

  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