The Check Wine rule detects potential adversary use of Wine to execute malicious code on Linux systems by identifying suspicious file artifacts associated with Wine components. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential Linux-based attacks that may bypass traditional Windows-focused defenses.
YARA Rule
rule Check_Wine
{
meta:
Author = "Nick Hoffman"
Description = "Checks for the existence of Wine"
Sample = "de1af0e97e94859d372be7fcf3a5daa5"
strings:
$ ="wine_get_unix_file_name"
condition:
any of them
}
This YARA rule can be deployed in the following contexts:
Scenario: Scheduled Windows Update Scan
Description: A Windows Update scan is initiated by the Windows Update service, which may trigger the Check_Wine YARA rule due to similar file patterns.
Filter/Exclusion: Exclude files or processes associated with svchost.exe or wuauclt.exe during scheduled update times.
Scenario: System File Checker (SFC) Scan
Description: The System File Checker tool (sfc.exe) runs to verify and repair system files, which may generate files or artifacts that match the Check_Wine rule.
Filter/Exclusion: Exclude processes or files related to sfc.exe or Windows Resource Protection.
Scenario: Microsoft Defender Antivirus Scan
Description: Microsoft Defender may temporarily create or modify files during a full system scan, which could be flagged by the Check_Wine rule.
Filter/Exclusion: Exclude processes or files related to MsMpEng.exe or Microsoft Defender Antivirus.
Scenario: PowerShell Script Execution for System Maintenance
Description: A legitimate PowerShell script (e.g., PowerShell.exe) running a system cleanup or configuration task may generate files or artifacts that match the rule.
Filter/Exclusion: Exclude processes or files with powershell.exe and a command line containing system maintenance or cleanup.
Scenario: Admin Task for Wine Compatibility Testing
Description: An administrator may use Wine (a compatibility layer for running Windows applications on Linux) to test software, which could trigger the rule.
Filter/Exclusion: Exclude processes or files associated with wine or winecfg when running in a controlled testing environment.