This hunt targets the execution of the Gh0st remote access trojan (RAT) within Windows environments to identify potential adversary lateral movement and command-and-control communications. Proactively hunting for this specific signature in Azure Sentinel is critical because early detection of low-severity Gh0st variants can prevent silent data exfiltration before the malware establishes persistent footholds across the network.
rule APT_WIN_Gh0st_ver : RAT
{
meta:
author = "@BryanNolen"
date = "2012-12"
type = "APT"
version = "1.1"
ref = "Detection of Gh0st RAT server DLL component"
ref1 = "http://www.mcafee.com/au/resources/white-papers/foundstone/wp-know-your-digital-enemy.pdf"
strings:
$library = "deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly"
$capability = "GetClipboardData"
$capability1 = "capCreateCaptureWindowA"
$capability2 = "CreateRemoteThread"
$capability3 = "WriteProcessMemory"
$capability4 = "LsaRetrievePrivateData"
$capability5 = "AdjustTokenPrivileges"
$function = "ResetSSDT"
$window = "WinSta0\\Default"
$magic = {47 6C 6F 62 61 6C 5C [5-9] 20 25 64} /* $magic = "Gh0st" */
condition:
all of them
}
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 APT WIN Gh0st ver detection rule in an enterprise environment, along with suggested filters or exclusions:
Endpoint Management Agent Updates (e.g., Ivanti, SCCM)
ghost.exe or similar binaries to perform disk imaging and partitioning tasks during maintenance windows. These processes may load memory modules with signatures matching the YARA rule’s heuristic for Gh0st persistence mechanisms.ccmexec.exe, IvantiAgentService.exe) and the file path resides within standard software deployment directories (e.g., C:\Program Files\Microsoft Configuration Manager\).Scheduled Disk Imaging Jobs via Ghost Solution Suite
ghost.exe to perform nightly backup and cloning operations. These scheduled tasks, often triggered by the Windows Task Scheduler (TaskScheduler.exe), execute with high privileges and generate network traffic and file system modifications that closely resemble the initial infection behavior of the Gh0st RAT.TaskScheduler.exe where the command line arguments contain keywords like /clone, /image, or specific job GUIDs associated with known backup schedules, and restrict this to non-business hours (e.g., 20:00–06:00).Virtualization Host Maintenance Tools