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 indicators allows the SOC to distinguish between legitimate security operations and stealthy malicious tooling that may mimic standard administrative processes.
rule HKTL_NET_GUID_SharpDomainSpray {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/HunnicCyber/SharpDomainSpray"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "76ffa92b-429b-4865-970d-4e7678ac34ea" 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 CI/CD Pipeline Execution
dotnet CLI or MSBuild. These processes often load standard .NET assemblies that share the same TypeLibGUIDs as security tools like Sysmon or specific Red Team frameworks.C:\Program Files\Microsoft Visual Studio*\MSBuild\Bin\MSBuild.exe, C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe) and restrict the alert to specific service accounts (e.g., DOMAIN\CI-Build-Service).Scenario: Scheduled Antivirus or EDR Scans
C:\Program Files\CrowdStrike\FalconSensor\csfalcon.exe) and exclude events where the parent process is a known security service account running during maintenance windows (e.g., 02:00–04:00 UTC).Scenario: Office 365 / Microsoft Teams Background Updates