This rule identifies potential adversary activity by monitoring for C# Red and Black team tools through their unique TypeLibGUID signatures within Azure Sentinel. Proactive hunting for these specific tool identifiers is essential to distinguish legitimate security operations from malicious reconnaissance or lateral movement attempts that mimic standard administrative utilities.
rule HKTL_NET_GUID_Random_CSharpTools {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/xorrior/Random-CSharpTools"
author = "Arnim Rupp"
date = "2020-12-21"
strings:
$typelibguid0 = "f7fc19da-67a3-437d-b3b0-2a257f77a00b" ascii nocase wide
$typelibguid1 = "47e85bb6-9138-4374-8092-0aeb301fe64b" ascii nocase wide
$typelibguid2 = "c7d854d8-4e3a-43a6-872f-e0710e5943f7" ascii nocase wide
$typelibguid3 = "d6685430-8d8d-4e2e-b202-de14efa25211" ascii nocase wide
$typelibguid4 = "1df925fc-9a89-4170-b763-1c735430b7d0" ascii nocase wide
$typelibguid5 = "817cc61b-8471-4c1e-b5d6-c754fc550a03" ascii nocase wide
$typelibguid6 = "60116613-c74e-41b9-b80e-35e02f25891e" 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 7 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the “Detects c# red/black-team tools via typelibguid” rule, along with recommended filters or exclusions:
Scenario: Automated CI/CD Pipeline Execution
msbuild.exe or dotnet.exe. These processes often load standard .NET assembly libraries that share the same typelibguid signatures as known red-team tools like SharpUp or Bloodhound.msbuild.exe, dotnet.exe, or vstt_build.exe AND the parent process is a CI service account (e.g., SYSTEM, NT SERVICE\Jenkins).Scenario: Office 365 ProPlus Background Updates
OfficeC2RClient.exe) or background sync services often instantiate C# components that utilize specific Type Library GUIDs identical to those found in tools like SharpHound or PowerSploit. This is common during off-hours maintenance windows.\Microsoft Office\ClickToRun\OfficeC2RClient.exe and exclude alerts occurring between 01:00 and 05:00 UTC on weekdays.Scenario: Enterprise Antivirus Heuristic Scanning
typelibguid patterns of black-team tools like Mimikatz or LaZagne.