The detection tools were tested against the previously collected and analyzed set of rootkits to evaluate their effectiveness.
5.1 Environment and Methodology
All detection tools were evaluated in a virtualized environment and a contained network. Depending on the available rootkit features (e.g., backdoors), an additional system was added to the network to simulate the attacker. After each rootkit evaluation, the virtual machine was fully reset. Depending on the rootkit’s age, either Ubuntu 22.04.2 LTS or 14.04.6 LTS was used as the operating system. No additional software was installed on the machines besides the rootkit, the detector, and their dependencies. The following sections detail how each tool was set up and under which constraints it was run.
rkhunter was downloaded from its SourceForge repository. Some of rkhunter’s modules utilize other tools like Tripwire or Unhide. These were not used during our evaluation to accurately assess rkhunter’s standalone capabilities. Besides that, rkhunter was run using its default configuration.
chkrootkit was compiled from source. Besides running the chkrootkit main utility, chkdir was also run independently against the system’s root directory (recursively). This produced significant numbers of false positives from inside the /proc directory, prompting us to filter the directory from the output. Because of this, chkdir is, for example, capable of detecting Reptile’s install directory under /reptile, but not Knark’s install directory /proc/knark.
Unhide was also compiled from source. The sub-utilities unhide-linux and unhide-tcp were run at least once using each available detection-mode. Note, that unhide-tcp, contrary to what its name might suggest, also detects hidden User Datagram Protocol (UDP) ports.
AIDE was installed via the apt package manager. The integrity database was generated using AIDE’s default configuration. After installing the rootkits, the new system state was compared to this snapshot. It is important to note that, depending on the time which has passed between generating the database and using it to check for changes, AIDE may produce large outputs, especially on a busy system. Interpreting these outputs and identifying malicious changes does require some experience. We primarily looked for changes to /etc/ld.so.preload, /lib/ld.so, /etc/passwd and /etc/shadow as well as new files which could be associated with known rootkits.
OSSEC was installed in a Server/Agent configuration following the official installation guide. The rootcheck module is run repeatedly in prespecified intervals. It is also executed as part of the agent’s installation procedure. The outputs were viewed on the server’s Web interface.
ClamAV was installed via apt and its malware signatures were updated using freshclam. It was then run recursively against the system’s root directory. ClamAV directly outputs infected files. Out of interest, we also looked into the scanning logs and noticed that in the instance of one rootkit (Father), an error occurred, when ClamAV attempted to scan one of the files manipulated by the rootkit. After some consideration, we decided to not count this as a successful detection, since it is not part of the tool’s regular output and was found coincidentally.
LKRG was compiled from source and its LKM was loaded into the kernel. This automatically generates the integrity database. The outputs of LKRG were read directly from the system’s kernel logs.
A “successful detection” includes all anomalous behavior that is not present on an uninfected system. A detection tool does not necessarily have to identify the threat as a rootkit or by a specific name for the detection to be counted as such. One rootkit (Puszek) caused a few tools to crash when scanning its files. We decided to count this as a successful detection. All utilities were also run at least once on a clean, uninfected system to determine their proneness for outputting false positives.
5.2 Simulated Scenarios
Some detection methods depend on certain rootkit features being active or previously collected data (see
Table 2) being available. To most accurately assess the effectiveness of the tested detection tools, we divided the evaluation into four distinct scenarios based on two criteria:
S1:
The rootkit has been installed, and no additional features have been enabled. The detector does not have access to previously collected data or knowledge.
S2:
The rootkit has been installed, and no additional features have been enabled. The detector does have access to previously collected data or knowledge.
S3:
All additional features available to the rootkit have been enabled. The detector does not have access to previously collected data or knowledge.
S4:
All additional features available to the rootkit have been enabled. The detector does have access to previously collected data or knowledge.
For this evaluation, “all additional features active” means: If the rootkits implements a backdoor, an active connection is established to it from a separate system. If the rootkits offer process hiding capabilities, at least one hidden process is created. If the rootkit implements arbitrary file hiding, at least one file and one directory is hidden. If the rootkits offers local privilege escalation, at least one process has its privileges elevated using it.
Table 2 shows the previously collected data and knowledge required by the tools for some or all of their detection approaches to function.