This hunt hypothesis targets adversaries leveraging C#-based offensive or defensive tools that register unique TypeLibGUIDs to establish persistence and evade signature-based detection within Azure Sentinel environments. Proactively hunting for these specific GUID patterns allows the SOC team to identify early-stage tool deployment by red teams or threat actors before they execute broader reconnaissance or lateral movement activities.
rule HKTL_NET_GUID_SharPersist {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/fireeye/SharPersist"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "9d1b853e-58f1-4ba5-aefc-5c221ca30e48" 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 rule “Detects c# red/black-team tools via typelibguid,” including suggested filters and exclusions:
Scenario: Automated .NET Deployment via PowerShell
PowerShell to deploy updates. This script invokes the .NET runtime (wof.exe) or specific deployment agents (e.g., Octopus Deploy Tentacle) which register new TypeLibGUIDs during the installation phase, mimicking Red Team tool behavior.ProcessName is powershell.exe AND CommandLine contains keywords like “Octo.Exe”, “Tentacle”, or “MSBuild” running on known deployment servers (e.g., Server-Deploy-01).Scenario: Endpoint Protection Scanning
ProcessName matching known EDR agents (e.g., Cns.exe, MsMpEng.exe) where the parent process is the OS scheduler (svchost.exe) or the EDR service itself, specifically when the activity occurs within the standard maintenance window (02:00–04:00).Scenario: Office 365 Add-in Initialization