lynis是一款开源的unix-based平台的审计工具。可以帮助审计员扫描unix系统以及可用的软件。程序主要探测,系统上安装的程序包,配置上的错误,以及安全问题和系统信息。
$ brew install lynis
root@kali:~/lynis# ./lynis -c -Q#全部检查(最常用)
root@kali:~/lynis# ./lynis -c -Q --pentest
root@kali:~# lynis -c -Q -q --auditor "yy mm" #只显示告警输出
4.3 可以使用-h 选项去显示所有可用参数,即是root@kali:~# lynis -h
威胁/影响分数
root@kali:~# leafpad /var/log/lynis.log
默认的报告文件位置:/var/log/lynis-report.dat.
root@kali:~# leafpad /var/log/lynis-report.dat
4 命令参数
lynis [scan mode] [other options]
FIRST TIME USAGE
When running Lynis for the first time, run: lynis audit system --quick
OPTIONS
--auditor <full name> Define the name of the auditor/pen-tester. When a full name is used, add double quotes, like "Your Name".
--checkall (or -c) Lynis performs a full check of the system,
--config Show which settings file or profile is being used, then quit.
--cronjob Perform automatic scan with cron safe options (no colors, no questions, no breaks).
--debug Display debug information to screen for troubleshooting purposes.
--dump-options Show all available parameters.
--logfile </path/to/logfile> Defines location and name of log file, instead of default /var/log/lynis.log.
--no-colors Do not use colors for messages, warnings and sections.
--no-log Redirect all logging information to /dev/null, prevent sensitive information to be written to disk.
--pentest Run a non-privileged scan, usually for penetration testing. Some of the tests will be skipped if they require root permissions.
--plugin-dir </path/to/plugins> Define location where plugins can be found.
--profile </path/to/profile> Provide alternative profile to perform the scan.
--quick (-Q) Do a quick scan (don't wait for user input).
--quiet (-q) Try to run as silent as possible, showing only warnings. This option activates --quick as well.
--report-file </path/to/report> Provide an alternative name for report file.
--reverse-colors Optimize screen output for light backgrounds.
--tests TEST-IDs Only run the specific test(s). When using multiple tests,add quotes around the line.
--tests-category <category> Only perform tests from particular tests. Use --view-categories to determine valid options.
--upload Upload data to Lynis Enterprise server.
--view-categories Display all available test categories.
Multiple parameters are allowed, though some parameters can only be
used together with others. When running Lynis without any parameters,
help will be shown and the program will exit.
EXIT CODES
Lynis uses exit codes to signal any invoking script. Currently the fol-
lowing codes are used:
0 Program exited normally, nothing found
1 Fatal error
64 An unknown parameter is used, or incomplete
65 Incorrect data encountered
66 Can't open file or directory
78 Lynis found 1 or more warnings or configurations errors
grep Suggestingon /var/log/lynis.log