Lynis 安全審計工具

2021-10-12 04:19:03 字數 3253 閱讀 6573

筆記-常用命令:

安裝i:

$ git clone

$ cd lynis

$ ./lynis audit system # 執行

安裝ii:

yum --enablerepo=epel -y install lynis

常用命令:

lynis -h #幫助

lynis show version #檢視版本號

lynis show commands #可用命令

lynis audit system #審計當前系統 ---系統的安全態勢

lynis show groups #有時我們不想掃瞄或審計整個系統的應用程式或服務,所以我們可以按類別審計自定義應用程式。我們可以先列出所有的組,然後選擇需要審計或掃瞄的組

lynis --tests-from-group "kernel firewalls" #對"kernel"和"firewalls"進行簡單的審計

lynis update info #更新

一旦掃瞄完畢,系統的審查報告就會自動生成,並儲存在/var/log/lynis.log中。

具體的審查流程可以檢視var/log/lynis-report.dat

審查報告含有該工具檢測到的潛在安全漏洞方面的警告資訊。比如說:

#grep warning /var/log/lynis.log 用來檢查報告內容

審查報告還含有許多建議措施,有助於加固你的linux系統。比如說:

#grep suggestion /var/log/lynis.log 用來檢查建議內容掃瞄你系統的安全漏洞

建立lynis計畫任務

如果你想為你的系統建立乙個日掃瞄報告,你可以設定cron:

$ crontab -e 新增cron任務: 30 22 * * * /usr/bin/lynis -c --auditor "automated" --cronjob > /var/log/lynis/report.txt 上面任務每天晚上10:30會執行掃瞄,並把輸出的資訊儲存到/var/log/lynis.log日誌檔案中。

一旦lynis開始掃瞄你的系統,它就會執行以下類別的審查工作

category

類別作用

system tools

系統工具

掃瞄可用工具;檢測系統二進位制**

boot and services

引導和服務

引導裝入程式和啟動服務

kernel

核心執行級別、已裝入模組、核心配置和核心轉儲

memory and processes

記憶體和程序

殭屍程序和輸入輸出等待程序

users,groups and authentication

使用者、使用者組和驗證

使用者組編號、sudoers檔案、可插拔驗證模組(pam)配置、密碼老化和預設掩碼

shells

file systems

檔案系統

掛載點、臨時檔案和根檔案系統

storage儲存

usb儲存(usb-storage)和火線開放式主機控制器介面(firewire ohci)

nfs check running nfs daemon

name services

名稱服務

dns搜尋

ports and packages

埠和軟體包

容易受到攻擊/可以公升級的程式包和安全儲存庫

networking

網路名稱伺服器、混雜介面和連線

printers and spools

印表機和假離線

通用unix列印系統(cups)配置

software:email and messaging

軟體:電子郵件和訊息傳送

exim status、postfix status、dovecot status、qmail status、sendmail status

software:firewalls

防火牆iptables、host based firewall

software:webserver

**伺服器

apache、nginx

ssh support

ssh支援

checking running ssh daemon

snmp support

checking running snmp daemon

databases

mysql根密碼

ldap services

checking openlda

phpsquid support

logging and files

日誌和檔案

syslog守護程式和日誌目錄

insecure services

不安全服務

checking inetd status

banners and identificationbanner

資訊和身份認證

scheduled tasks

排程任務

checking crontab/cronjob /vrontabs

accounting

賬號accounting information/sysstat accounting data/auditd

time and synchronization

時間和同步

ntp守護程式

cryptography

密碼學checking for expired ssl certificates

virtualization虛擬化

containers

security frameworks

安全框架

software:file integrity

檔案完整性

software:system tooling

checking automation tooling/checing for ids/ips tooling

software:malware

惡意軟體掃瞄工具

file permissions

home directories

主目錄checking shell history files

kernel hardening

hardening

installed compiler installed malware scanner

custom tests

running custom tests

Linux系統安全審計工具Lynis

lynis是一款開源的系統安全審計功能工具,該工具由一系列的shell指令碼構成 系統進行全面安全檢查的工具,可以發現系統 賬戶 程序等多個層面所存在的安全風險,並以直觀的方式逐一列出,支援目前主流的linux平台。一 lynis檢查專案大致如下 系統程式是否被置換或篡改,避免管理者或使用者執行惡意...

無線安全審計工具aircrack ng詳解

無線滲透試的工具有很多,在windows下和linux下的工具各有千秋,因在windows下的工具基本都是圖形介面,操作起來比較直觀易懂,在此就不再做過多介紹,本方重點介紹在linux下的一種通用的方法。首先講一下現行無線滲透試的一般方法和原理。目前無線滲透試的兩種方法 1 抓握手包,跑包。2 通過...

網路安全審計工具nmap

2.nmap ip 掃瞄某個ip位址,並列出該ip的埠 埠狀態與服務名稱 3.nmap ip ip ip 同時掃瞄多個ip,如nmap 172.18.100.1 172.18.100.2 4.nmap 172.18.100.1 100 同時掃瞄這100臺主機 5.nmap 172.18.1 100....