This hunt hypothesis targets adversaries leveraging C#-based Red and Black team tools that generate unique TypeLibGUID artifacts to establish a foothold or conduct reconnaissance within the environment. Proactive hunting for these specific GUID signatures in Azure Sentinel is essential because they often represent early-stage tool deployment that may evade traditional signature-based detections, allowing the SOC team to identify and investigate potential lateral movement or command-and-control activities before escalation occurs.
rule HKTL_NET_GUID_SharpStay {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/0xthirteen/SharpStay"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "2963c954-7b1e-47f5-b4fa-2fc1f0d56aea" 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 1 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the “Detects C# Red/Black-Team Tools via TypelibGUID” rule, including suggested filters and exclusions:
Scenario: Automated Build Pipeline Execution
msbuild.exe process often loads specific COM typelib GUIDs associated with Red Team simulation frameworks during the build phase, triggering alerts even though no active attack is occurring.msbuild.exe, dotnet.exe, or vstest.console.exe running under service accounts (e.g., NT SERVICE\BuildAgent) on dedicated build server hostnames (e.g., *-BUILD-01).Scenario: Scheduled Endpoint Management Scans
QualysCC.exe or MsMpEng.exe between 01:00 and 05:00 UTC, or exclude specific typelib GUIDs known to belong to the endpoint management vendor.Scenario: Active Directory Group Policy Updates
gpupdate.exe process invokes COM objects that share typelib GUIDs with common Red Team reconnaissance tools. This is particularly common during weekly policy refresh