This hunt targets adversaries leveraging C#-based red and black team tools that register unique TypeLibGUIDs to establish persistence or execute reconnaissance within Azure environments. Proactively hunting for these specific GUID signatures in Azure Sentinel allows the SOC team to distinguish legitimate automation from stealthy adversary tooling, even when initial alerts are flagged with low severity.
rule HKTL_NET_GUID_SharpDPAPI {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/GhostPack/SharpDPAPI"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "5f026c27-f8e6-4052-b231-8451c6a73838" ascii nocase wide
$typelibguid1 = "2f00a05b-263d-4fcc-846b-da82bd684603" ascii nocase wide
condition:
(uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550) and any of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the Detects C# Red/Black-Team Tools via TypelibGUID rule, including suggested filters and exclusions:
Scenario: Automated Patch Management Deployment (SCCM/MECM)
ccmexec.exe) frequently loads C# assemblies to manage software updates. During the deployment of .NET Framework patches or application packages, it generates a typelibguid associated with internal Microsoft management libraries that mimic Red/Blue team tool signatures.ccmexec.exe and the file path contains \Microsoft\CCM\. Additionally, filter out specific GUIDs known to belong to the SCCM agent (e.g., {A1B2C3D4-E5F6-7890...}).Scenario: Scheduled Antivirus Real-Time Scanning
typelibguid often flagged by the rule as an external “Red Team” reconnaissance tool.C:\Program Files\CrowdStrike\csagent.exe, Symantec Endpoint Protection\SmcGui.exe). Whitelist the specific typelibguid values associated with these vendors’ core scanning modules.Scenario: Microsoft Office 365 Click-to-Run Updates
OfficeClickToRun.exe) manages background