The hypothesis is that the detection identifies potential APT activity involving Bestia.3.02.012.07 malware, which has been linked to targeted attacks on Polish government systems. SOC teams should proactively hunt for this behavior to identify and mitigate advanced persistent threats before they cause significant damage.
YARA Rule
rule APT_bestia
{
meta:
author = "Adam Ziaja <[email protected]> http://adamziaja.com"
date = "2014-03-19"
description = "Bestia.3.02.012.07 malware used in APT attacks on Polish government"
references = "http://zaufanatrzeciastrona.pl/post/ukierunkowany-atak-na-pracownikow-polskich-samorzadow/" /* PL */
hash0 = "9bb03bb5af40d1202378f95a6485fba8"
hash1 = "7d9a806e0da0b869b10870dd6c7692c5"
maltype = "apt"
filetype = "exe"
strings:
/* generated with https://github.com/Xen0ph0n/YaraGenerator */
$string0 = "u4(UeK"
$string1 = "nMiq/'p"
$string2 = "_9pJMf"
$string3 = "ICMP.DLL"
$string4 = "EG}QAp"
$string5 = "tsjWj:U"
$string6 = "FileVersion" wide
$string7 = "O2nQpp"
$string8 = "2}W8we"
$string9 = "ILqkC:l"
$string10 = "f1yzMk"
$string11 = "AutoIt v3 Script: 3, 3, 8, 1" wide
$string12 = "wj<1uH"
$string13 = "6fL-uD"
$string14 = "B9Iavo<"
$string15 = "rUS)sO"
$string16 = "FJH{_/f"
$string17 = "3e 03V"
condition:
17 of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 18 string patterns in its detection logic.
Scenario: Scheduled System Maintenance Task
Description: A legitimate scheduled task runs a script that matches the YARA rule due to similar string patterns (e.g., bestia in a log file or script name).
Filter/Exclusion: Check for process.name containing schtasks.exe or task scheduler and exclude processes with taskname matching known maintenance tasks (e.g., UpdateOrchestrator).
Scenario: Admin Debugging Session
Description: A system administrator is using a debugger (e.g., x64dbg, GDB) to analyze a suspicious process, and the debugged process matches the YARA rule.
Filter/Exclusion: Filter by process.parent.name containing x64dbg or gdb, or check for process.command_line containing debug-related flags (e.g., --debug).
Scenario: Log File Parsing by SIEM Tool
Description: A SIEM tool (e.g., Splunk, ELK) parses log files and generates alerts due to the presence of the string bestia in log entries (e.g., from eventlog or syslog).
Filter/Exclusion: Exclude entries where source is a SIEM tool or log parser, or filter by message containing known log parsing keywords (e.g., splunk, logstash).
Scenario: PowerShell Script for System Monitoring
Description: A legitimate PowerShell script (e.g., PSMonitor, PSLog), used for system monitoring, includes the string bestia in its script name or content.
Filter/Exclusion: Filter by process.name containing powershell.exe and check for script.name or script.path matching known monitoring tools (e.g