在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ Linux/ 黑客入侵檢查
Linux 下常用壓縮文件的解壓、壓縮
  • 1.
Maven 安裝和配置
  • 1.
CentOS 網絡設置
  • 1.
  • 1.
  • 1.
TeamCity 安裝和配置
Zsh 入門
  • 1.
  • 1.
Bash 其他常用命令
Bash 常用命令
  • 1.
  • 1.
  • 1.
Ubuntu 介紹
Ubuntu 網絡相關設置問題
Nginx 安裝和配置
  • 1.
  • 1.
  • 1.
  • 1.
Linux-Tutorial
Nexus 安裝和配置
  • 1.
黑客入侵檢查
Yum 下載安裝包及對應依賴包
  • 1.
  • 1.
Tomcat 8 安裝和配置、優(yōu)化
  • 1.
Ubuntu 安裝和分區(qū)

黑客入侵檢查


思路

  • 掃描木馬工具:clamAV
  • CentOS 安裝:yum install -y clamav*
  • 啟動 clamAV 服務:service clamd restart
  • 更新病毒庫:freshclam
  • 掃描方法:
    • 掃描 /etc 目錄,并把掃描結果放在 /root 目錄下:clamscan -r /etc --max-dir-recursion=5 -l /root/etcclamav.log
    • 掃描 /bin 目錄,并把掃描結果放在 /root 目錄下:clamscan -r /bin --max-dir-recursion=5 -l /root/binclamav.log
    • 掃描 /usr 目錄,并把掃描結果放在 /root 目錄下:clamscan -r /usr --max-dir-recursion=5 -l /root/usrclamav.log
  • 如果日志有類似內容,表示有木馬病毒:
    • /usr/bin/.sshd: Linux.Trojan.Agent FOUND
    • /usr/sbin/ss: Linux.Trojan.Agent FOUND
    • /usr/sbin/lsof: Linux.Trojan.Agent FOUND
  • 看下當前有多少登錄者:who
  • 看下最近有哪些登錄者:last
  • 查看最近嘗試登錄的賬號信息:grep "sshd" /var/log/secure
    • 很多這種信息就表示有人在不斷地嘗試用 root 登錄:Failed password for root from 222.186.56.168 port 4080 ssh2
  • 查看最近登錄成功的賬號信息:grep "Accepted" /var/log/secure,可以看到:pop3, ssh, telnet, ftp 類型
  • 看下查看系統(tǒng)資源占用有無異常:top
  • 看下所有進程:ps aux
  • 查看當前系統(tǒng)登錄者有哪些,及其登錄記錄:last | more
  • 把最近執(zhí)行的所有命令輸出到一個文件,然后下載下來細細研究:history >> /opt/test.txt
  • 查看當前系統(tǒng)所有用戶有哪些:cat /etc/passwd |awk -F \: '{print $1}'
    • 更多詳細可以用:cat /etc/passwd
  • 查看開放的端口,比如常用的80,22,8009,后面的箭頭表示端口對應占用的程序:netstat -lnp
  • 檢查某個端口的具體信息:lsof -i :18954
  • 檢查啟動項:chkconfig
  • 檢查定時器:cat /etc/crontab
  • 檢查其他系統(tǒng)重要文件:
    • cat /etc/rc.local
    • cd /etc/init.d;ll
  • 檢查文件:
    • find / -uid 0 –perm -4000 –print
    • find / -size +10000k –print
    • find / -name "…" –print
    • find / -name ".. " –print
    • find / -name ". " –print
    • find / -name " " –print
  • 下載 iftop 分析流量,查看是否被黑客當做肉雞使用
  • 安裝 iftop
    • 官網:http://www.ex-parrot.com/~pdw/iftop/
    • 使用文章:https://linux.cn/article-1843-1.html
    • 沒有安裝第三方源的情況:
      • 安裝依賴包:yum install -y flex byacc libpcap ncurses ncurses-devel libpcap-devel
      • 下載源碼包:wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
      • 解壓:tar zxf iftop-0.17.tar.gz
      • 進入解壓目錄:cd iftop-0.17/
      • 編譯:./configure
      • 安裝:make && make install
    • 有第三方源的情況(eg:EPEL):
      • yum install -y iftop
  • 運行:iftop
    • 顯示端口與 IP 信息:iftop -nP
中間部分:外部連接列表,即記錄了哪些ip正在和本機的網絡連接

右邊部分:實時參數分別是該訪問 ip 連接到本機 2 秒,10 秒和 40 秒的平均流量

=> 代表發(fā)送數據,<= 代表接收數據

底部會顯示一些全局的統(tǒng)計數據,peek 是指峰值情況,cumm 是從 iftop 運行至今的累計情況,而 rates 表示最近 2 秒、10 秒、40 秒內總共接收或者發(fā)送的平均網絡流量。

TX:(發(fā)送流量)  cumm:   143MB   peak:   10.5Mb    rates:   1.03Mb  1.54Mb  2.10Mb
RX:(接收流量)          12.7GB          228Mb              189Mb   191Mb   183Mb
TOTAL:(總的流量)       12.9GB          229Mb              190Mb   193Mb   185MbW
  • 禁用 root 賬號登錄:vim /etc/ssh/sshd_config
    • 把 PermitRootLogin 屬性 yes 改為 no
  • 如果安全度要更高,可以考慮禁用口令登錄,采用私鑰/公鑰方式:vim /etc/ssh/sshd_config
    • 設置屬性:PasswordAuthentication 為 no
  • 如果還要限制指定 IP 登錄,可以考慮編輯:hosts.allow 和 hosts.deny 兩個文件

資料