The LinuxElknot detection rule identifies potential adversary activity involving the Elknot malware, which is often used for C2 communication and persistence on Linux systems. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect and respond to advanced persistent threats that may be leveraging low-severity indicators to evade traditional detection methods.
YARA Rule
rule LinuxElknot
{
meta:
Author = "@benkow_"
Date = "2013/12/24"
Description = "Strings inside"
Reference = "http://www.kernelmode.info/forum/viewtopic.php?f=16&t=3099"
strings:
$a = "ZN8CUtility7DeCryptEPciPKci"
$b = "ZN13CThreadAttack5StartEP11CCmdMessage"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Scenario: System update using apt or yum
Description: Legitimate package management operations may trigger the rule due to similar file names or strings.
Filter/Exclusion: Check for presence of apt or yum in the command line context, or filter by process names like apt-get, yum, or dnf.
Scenario: Scheduled backup job using rsync or tar
Description: Backup scripts or cron jobs may generate similar artifacts to the malicious behavior detected by the rule.
Filter/Exclusion: Filter by process names like rsync, tar, or backup in the command line, or check for known backup directories like /backup or /var/backups.
Scenario: Admin task using systemd or init scripts
Description: Systemd services or init scripts may have similar names or behaviors to the malicious payload.
Filter/Exclusion: Filter by process names like systemd, init, or service, or check for known service files in /etc/systemd/system/ or /etc/init.d/.
Scenario: Logrotate configuration or log management task
Description: Logrotate or other log management tools may create files or processes that match the YARA signature.
Filter/Exclusion: Filter by process names like logrotate, or check for presence of /etc/logrotate.conf or /var/log/ in the command line.
Scenario: User-generated script or cron job using bash or sh
Description: Custom scripts or cron jobs written by users may inadvertently match the YARA rule due to similar syntax or file names.
Filter/Exclusion: Filter by presence of cron or crontab in the command line, or check for script locations like `/home