This hunt targets adversaries leveraging C#-based red and black team tools that expose unique typelibguid identifiers to establish persistence or execute reconnaissance within Azure environments. Proactively hunting for these specific GUIDs allows the SOC team to distinguish legitimate security tooling from malicious C# payloads, thereby reducing alert fatigue while identifying early-stage lateral movement or command-and-control activities.
rule HKTL_NET_GUID_AmsiScanBufferBypass {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/rasta-mouse/AmsiScanBufferBypass"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "431ef2d9-5cca-41d3-87ba-c7f5e4582dd2" 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 4 specific false positive scenarios for the rule “Detects c# red/blue-team tools via typelibguid” in an enterprise environment, along with suggested filters:
Automated .NET Build and Deployment Pipelines
MSBuild.exe or dotnet.exe. These tools load standard Microsoft type libraries to compile code, run unit tests, or package applications, triggering the typelibguid signature associated with development tooling.NT SERVICE\BuildAgent, SYSTEM) located in known build directories such as C:\Program Files\Microsoft Visual Studio\... or C:\Jenkins\workspace\.Enterprise Antivirus and Endpoint Protection Scans
MsMpEng.exe, CfSvc.exe, Symantec Endpoint Protection) and restrict the rule to only trigger if the parent process is not a security service.Scheduled Group Policy and Configuration Management Tasks