This rule identifies potential adversary activity by detecting C#-based red and black team tools through their unique TypeLibGUID signatures within Azure Sentinel logs. Proactive hunting for these specific tool identifiers allows the SOC team to distinguish between legitimate security operations and malicious reconnaissance or lateral movement attempts that mimic standard administrative utilities.
rule HKTL_NET_GUID_SharpWitness {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/rasta-mouse/SharpWitness"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "b9f6ec34-4ccc-4247-bcef-c1daab9b4469" 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 Pipelines (Jenkins/GitLab CI)
msbuild.exe or custom build agents. These processes often instantiate .NET assemblies that register specific Type Library GUIDs identical to those used by Red Team simulation tools (e.g., SharpUp, BloodHound).\Jenkins\, \GitLab\runner\, or \AzureDevOps\ and filter for parent processes named msbuild.exe or dotnet.exe.Scenario: Endpoint Protection Scanning (CrowdStrike/SentinelOne)
SharpView or Lateral-Tool. This triggers alerts during routine full-system scans.C:\Program Files\CrowdStrike\csagent.exe) and exclude events where the parent process is the EDR service itself.Scenario: Scheduled System Health Checks
Get-ADUser via a wrapper). These scripts may utilize the same underlying .NET Type Library GUIDs as forensic tools like Rubeus or PowerSploit.