Lynis is a security auditing tool for UNIX derivatives like Linux, macOS, BSD, Solaris, AIX, and others. It performs an in-depth security scan. It is used by system administrators, auditors and security professionals, all over the world. Some of the features are:
Basics
Support
Reporting
Also Read – RapidRepoPull : Quickly Pull & Install Repos from its List
Installation via Git
Clone project
The first step is cloning the project. Before doing so, select the parent directory. Git will create a ‘lynis’ subdirectory with the full program in it.
$ cd /usr/local
$ git clone https://github.com/CISOfy/lynis
Cloning into ‘lynis’…
remote: Counting objects: 1733, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 1733 (delta 3), reused 0 (delta 0), pack-reused 1725
Receiving objects: 100% (1733/1733), 886.18 KiB | 378.00 KiB/s, done.
Resolving deltas: 100% (1204/1204), done.
Checking connectivity… done.
$ cd lynis
That is it. Time to run your first security audit:
$ lynis audit system
Although no configuration is required, there are a few useful commands to learn.
Running Lynis
Ensure that you are in the right directory and add ‘./’ in front of the command, like:
$ ./lynis
Lynis can run without any preconfiguration. Configuration and fine-tuning is possible though and will be covered in later sections. For now we will run a basic scan:
$ lynis audit system
(use ./lynis audit system to start Lynis from the local directory if you didn’t install it as a software package)
Lynis and pauses
By default Lynis starts and pauses after the first section. With CTRL+C you can stop the program. With ENTER it will continue to the next set of tests.
If we want to run Lynis without any pauses, we could give it an additional parameter: –quick. This will enable the “quick” option, ideal for running Lynis while you do other things.
$ lynis audit system –quick
Report and Logging
Lynis performs an in-depth audit and reports its findings to the following outputs:
1. Screen output
Lynis scans the system and performs hundreds of tests. For most of these tests, a result will be displayed on the screen.
Possible tests results include:
2. Log file
The results are displayed on screen during the system scan. Additional details are logged in a separate file (default: /var/log/lynis.log). This information is useful for advanced testers, to see what the program did in the background, or where anomalies showed up.
Information in the log file
Remark: the log file is purged every scan. If you need debugging or logging information for previous scans, schedule log rotation or make a backup before running Lynis again.
3. Report files
During the audit process, Lynis will gather findings and other data points. This information is stored in the report file, which is by default /var/log/lynis-report.dat.
Lynis supports one report format, which can be used to gather results and display them in a custom or (more) friendly presentation. The report file can also be used to compare scan results from the past with a current scan. Lynis Enterprise has much more possibilities to display data, including extended reports in several formats.
Contents of report file:
When an option could have multiple values (like installed packages for example), brackets ([]) are added. Example: installed_package[]=Package-1.0.0
shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…
MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…