This detection identifies the execution of Havex malware within Windows environments by leveraging a specific YARA signature to capture its unique behavioral artifacts. Proactive hunting for this threat in Azure Sentinel is essential to uncover early-stage lateral movement and command-and-control communications that may precede more severe ransomware or botnet activities.
rule Win32OPCHavex
{
meta:
Author = "BAE Systems"
Date = "2014/06/23"
Description = "Rule for identifying OPC version of HAVEX"
Reference = "www.f-secure.com/weblog/archives/00002718.html"
strings:
$mzhdr = "MZ"
$dll = "7CFC52CD3F87.dll"
$a1 = "Start finging of LAN hosts..." wide
$a2 = "Finding was fault. Unexpective error" wide
$a3 = "Was found %i hosts in LAN:" wide
$a4 = "Hosts was't found." wide
$a5 = "Start finging of OPC Servers..." wide
$a6 = "Was found %i OPC Servers." wide
$a7 = "OPC Servers not found. Programm finished" wide
$a8 = "%s[%s]!!!EXEPTION %i!!!" wide
$a9 = "Start finging of OPC Tags..." wide
condition:
$mzhdr at 0 and ($dll or (any of ($a*)))
}
This YARA rule can be deployed in the following contexts:
This rule contains 11 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the Win32OPCHavex detection rule in an enterprise environment, along with suggested filters or exclusions:
Antivirus Real-Time Scanning Engine Activity
MsMpEng.exe for Microsoft Defender or ccSvcHst.exe for CrowdStrike) when they are actively updating their heuristic definitions or performing deep file system scans. These engines often spawn child processes that load similar DLLs or execute memory patterns resembling the Havex malware’s command-and-control initialization.MsMpEng.exe, ccSvcHst.exe, SophosAutoUpdate.exe) and their specific file paths within the %ProgramFiles% directories.Scheduled Software Deployment via SCCM or Intune
msiexec.exe or custom installers. These deployment agents often create temporary files and execute network connections to internal repositories that mimic the Havex beacon behavior, particularly if the installer uses a specific compression library flagged by the YARA rule.ccmexec.exe (SCCM) or IntuneManagementExtension.exe, and filter out file paths located in temporary deployment folders like %ProgramData%\Microsoft\CCMCache.Enterprise Patch Management Scans (e.g., WSUS or Qualys)