This rule identifies the execution of specialized C# Red and Black team tools by analyzing unique TypeLibGUID values to distinguish legitimate security operations from potential adversary activity. Proactive hunting for these indicators in Azure Sentinel is essential to differentiate between authorized testing artifacts and malicious reconnaissance or tool deployment that may mimic standard administrative behavior.
rule HKTL_NET_GUID_NoMSBuild {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/rvrsh3ll/NoMSBuild"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "034a7b9f-18df-45da-b870-0e1cef500215" ascii nocase wide
$typelibguid1 = "59b449d7-c1e8-4f47-80b8-7375178961db" 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 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)
TypelibGUIDs during the build process, mimicking the footprint of Red Team execution tools.NT SERVICE\Jenkins or gitlab-runner) on dedicated CI/CD server hostnames. Additionally, filter out events where the parent process is a known build orchestrator like msbuild.exe or dotnet.exe.Scenario: Enterprise Endpoint Management (Microsoft Intune/SCCM)
TypelibGUID events that resemble security tooling activity.ccmexec.exe (SCCM) or IntuneManagementExtension.exe. Furthermore, filter out GUIDs known to be associated with Microsoft Management Suite components by maintaining a whitelist of standard enterprise management GUIDs.Scenario: Scheduled PowerShell Automation Scripts
.exe or invoked via dotnet) for log rotation, backup verification, or health checks. These scripts often load specific COM libraries to interact with the OS, triggering the detection rule during their execution window.