This hunt targets adversaries leveraging C#-based Red and Black team tools that expose unique TypeLibGUID artifacts to evade standard signature-based detection. Proactively hunting for these specific GUIDs in Azure Sentinel is critical because it enables the SOC team to identify sophisticated reconnaissance or post-exploitation activities that often bypass initial low-severity alerts.
rule HKTL_NET_GUID_SharpShell {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/cobbr/SharpShell"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "bdba47c5-e823-4404-91d0-7f6561279525" ascii nocase wide
$typelibguid1 = "b84548dc-d926-4b39-8293-fa0bdef34d49" 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:
Scheduled .NET Framework Health Checks
mscorsvw.exe or specific diagnostic utilities to verify the integrity of the .NET runtime on servers. These tools often instantiate standard C# assemblies that share common Type Library GUIDs with known red-team frameworks like Cobalt Strike’s Beacon or Empire, triggering alerts during routine maintenance windows.C:\Windows\Microsoft.NET\Framework* and C:\Program Files (x86)\Microsoft.NET\Framework*. Additionally, filter out events occurring between 02:00–04:00 UTC on weekdays if these checks are known to be scheduled during off-hours.Deployment of Internal C# Management Agents
AssetAgent.exe, SCCMClientService.exe) and filter by specific parent processes such as TaskScheduler or ccmexec.exe. Verify the SHA-256 hash of the executable against a whitelist of approved internal binaries.Microsoft Office Add-in Initialization