CommentCrew-threat-apt1 detects potential adversary behavior involving suspicious comment creation or modification in Azure resources, which may indicate reconnaissance or persistence activities. SOC teams should proactively hunt for this behavior to identify early-stage threats and prevent lateral movement or data exfiltration in their Azure Sentinel environment.
YARA Rule
rule COMBOS_APT1
{
meta:
author = "AlienVault Labs"
info = "CommentCrew-threat-apt1"
strings:
$s1 = "Mozilla4.0 (compatible; MSIE 7.0; Win32)" wide ascii
$s2 = "Mozilla5.1 (compatible; MSIE 8.0; Win32)" wide ascii
$s3 = "Delay" wide ascii
$s4 = "Getfile" wide ascii
$s5 = "Putfile" wide ascii
$s6 = "---[ Virtual Shell]---" wide ascii
$s7 = "Not Comming From Our Server %s." wide ascii
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 7 string patterns in its detection logic.
Scenario: A system administrator is using PowerShell to automate the deployment of a new application, which includes a comment in the script that matches the rule’s signature.
Filter/Exclusion: process.name != "powershell.exe" OR process.parent.name != "task scheduler"
Note: This could also be filtered by checking the script’s origin or using a whitelist of known admin scripts.
Scenario: A scheduled job runs a script that contains a comment matching the rule’s pattern, such as # This is a test script.
Filter/Exclusion: process.parent.name == "schtasks.exe" OR process.name == "schtasks.exe"
Note: This is common in enterprise environments for routine maintenance tasks.
Scenario: A database backup script includes a comment that matches the rule, such as # Backup initiated at 2:00 AM.
Filter/Exclusion: process.name == "sqlcmd.exe" OR process.name == "mysqldump.exe"
Note: These tools are often used for routine backups and may include such comments.
Scenario: A system update task runs a script that contains a comment like # Update initiated by Windows Update.
Filter/Exclusion: process.name == "wuauclt.exe" OR process.parent.name == "task scheduler"
Note: Windows Update tasks often run scripts with such comments.
Scenario: A log parsing script written in Python includes a comment that matches the rule, such as # Parsing logs for security analysis.
Filter/Exclusion: process.name == "python.exe" OR process.parent.name == "task scheduler"
Note: Log parsing is a common legitimate use case for scripts with descriptive comments.