TheMask/Careto adversaries use custom CnC communication signatures to exfiltrate data and maintain command and control, which may evade standard detection mechanisms. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential long-term persistence and data exfiltration activities.
YARA Rule
rule Careto_CnC
{
meta:
author = "AlienVault (Alberto Ortega)"
description = "TheMask / Careto CnC communication signature"
reference = "www.securelist.com/en/downloads/vlpdfs/unveilingthemask_v1.0.pdf"
date = "2014/02/11"
strings:
$1 = "cgi-bin/commcgi.cgi" ascii wide
$2 = "Group" ascii wide
$3 = "Install" ascii wide
$4 = "Bn" ascii wide
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 4 string patterns in its detection logic.
Scenario: Legitimate scheduled backup job using vssadmin to create shadow copies
Filter/Exclusion: Exclude processes initiated by vssadmin or associated with backup services like Microsoft Backup or VSS
Scenario: System update using Windows Update or Group Policy client services
Filter/Exclusion: Exclude processes with svchost.exe associated with wuauserv or gpsvc services
Scenario: Admin task using taskhost.exe to run maintenance scripts or PowerShell remoting
Filter/Exclusion: Exclude processes initiated by taskhost.exe with known administrative tasks or scripts in trusted directories
Scenario: Network discovery or ping sweep using nmap or arp commands
Filter/Exclusion: Exclude traffic originating from nmap.exe, arp.exe, or IP ranges used for internal network discovery
Scenario: Remote desktop connection or file transfer using mstsc.exe or pscp.exe
Filter/Exclusion: Exclude connections from mstsc.exe or pscp.exe to known internal IP ranges or trusted remote hosts