The hypothesis is that the detection of BlackEnergy 2 Malware indicates an adversary is leveraging advanced persistent threat tactics to establish a foothold in the network. A SOC team should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential long-term compromise and exfiltration activities.
YARA Rule
rule BlackEnergy_BE_2
{
meta:
description = "Detects BlackEnergy 2 Malware"
author = "Florian Roth"
reference = "http://goo.gl/DThzLz"
date = "2015/02/19"
hash = "983cfcf3aaaeff1ad82eb70f77088ad6ccedee77"
strings:
$s0 = "<description> Windows system utility service </description>" fullword ascii
$s1 = "WindowsSysUtility - Unicode" fullword wide
$s2 = "msiexec.exe" fullword wide
$s3 = "WinHelpW" fullword ascii
$s4 = "ReadProcessMemory" fullword ascii
condition:
uint16(0) == 0x5a4d and filesize < 250KB and all of ($s*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 5 string patterns in its detection logic.
Scenario: Legitimate scheduled backup job using Veeam Backup & Replication
Filter/Exclusion: Exclude processes associated with veeam.exe or check for the presence of backup in the command line arguments.
Scenario: System administrator running PowerShell scripts for routine system maintenance
Filter/Exclusion: Exclude processes with powershell.exe where the command line includes -Command or -File and the script path is known to be internal (e.g., C:\Windows\System32\WindowsPowerShell\v1.0\).
Scenario: Use of Microsoft Sysinternals tools (e.g., Process Explorer, Procmon) for troubleshooting
Filter/Exclusion: Exclude processes with procmon.exe, process.explorer.exe, or other Sysinternals executables.
Scenario: Execution of Windows Task Scheduler jobs for software updates or patches
Filter/Exclusion: Exclude processes launched by schtasks.exe or with the command line containing schtasks or Task Scheduler.
Scenario: Legitimate use of Windows Event Log tools (e.g., eventvwr.exe) for log analysis
Filter/Exclusion: Exclude processes with eventvwr.exe or check for the presence of eventlog or event viewer in the command line.