This hunt identifies potential adversary activity by detecting C#-based red and black team tools through their unique TypeLibGUID signatures within Azure Sentinel logs. Proactively hunting for these specific identifiers allows the SOC team to distinguish between legitimate security testing operations and malicious tool usage that may mimic standard administrative behavior, thereby reducing false positives and accelerating incident response.
rule HKTL_NET_GUID_PoshC2_Misc {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/nettitude/PoshC2_Misc"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "85773eb7-b159-45fe-96cd-11bad51da6de" ascii nocase wide
$typelibguid1 = "9d32ad59-4093-420d-b45c-5fff391e990d" 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 or exclusions:
Scenario: Automated CI/CD Pipeline Execution
typelibguid as known security tools like Cobalt Strike Beacon, SharpUp, or PowerSploit.*\build\*, *\agent\*, or *\svc-build and the user account is a dedicated service account (e.g., NT SERVICE\Jenkins or svc-cicd).Scenario: Scheduled Microsoft Defender for Endpoint Scans
typelibguid signatures used by red-team tools like SharpHound or BloodHound.MsMpEng.exe (Microsoft Defender) or SenseService.exe, as these are legitimate security scanning engines rather than adversarial tooling.Scenario: Enterprise Backup and Archiving Jobs