This hunt targets adversaries leveraging C#-based Red and Black team tools that generate unique TypeLibGUID artifacts to establish persistence or execute reconnaissance within the environment. Proactively hunting for these specific GUIDs in Azure Sentinel is critical because they often indicate early-stage tool deployment or lateral movement attempts that may bypass standard signature-based detections due to their low severity classification.
rule HKTL_NET_GUID_SafetyKatz {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/GhostPack/SafetyKatz"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "8347e81b-89fc-42a9-b22c-f59a6a572dec" 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 4 specific false positive scenarios for the C# Red/Black-Team Tools via TypelibGUID detection rule in an enterprise environment:
Automated Compliance Scanning with Microsoft Configuration Analyzer Tool (MCAT)
C:\Program Files\EnterpriseApps directory.MCAT.exe) and restrict the scope to the specific file path where compliance scans are executed (e.g., ProcessName: MCAT.exe AND FilePath: C:\Program Files\EnterpriseApps\*).Software Deployment via SCCM/Intune Custom Installers
ccmexec.exe or MicrosoftEdgeWebview2.exe (common for modern installers) occurring within a defined maintenance window (e.g., 01:00–05:00 UTC).Enterprise Antivirus Real-Time Scanning of .NET Frameworks
C:\Windows\Microsoft.NET\Framework64 directory. When scanning large C# binaries, the AV engine loads metadata via TypeLibGUIDs to verify digital signatures, generating alerts that resemble tool execution.