This hunt hypothesis posits that adversaries are leveraging C#-based red and black team tools within the environment, identifiable by unique typelibguid artifacts often associated with legitimate security utilities. Proactively hunting for these specific GUIDs in Azure Sentinel is critical to distinguish between authorized defensive tooling and potential adversary persistence mechanisms masquerading as standard administrative software.
rule HKTL_NET_GUID_AllTheThings {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/johnjohnsp1/AllTheThings"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "0547ff40-5255-42a2-beb7-2ff0dbf7d3ba" 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”, along with suggested filters or exclusions:
Scenario: Automated Build and Deployment Pipelines
csc.exe) or deployment scripts that instantiate .NET assemblies with specific TypeLib GUIDs. These tools often mimic the behavior of red-team utilities like SharpChk or PowerShell Empire agents during the build process.java.exe, node.exe, dotnet.exe) and the command line contains flags related to build artifacts (e.g., /t:Build, -p:Configuration=Release).Scenario: Enterprise Endpoint Management Software
SharpHunt or BloodHound.C:\Program Files\Microsoft SCCM\Agent, C:\Program Files\Ivanti) and restrict the rule to only trigger on processes launched from user home directories or temporary folders (%TEMP%).Scenario: Scheduled Microsoft Office Macro Execution
excel.exe which loads VBA macros written in C# or COM add