This hunt targets adversary behavior involving the execution of C# Red/Black team tools identified by unique typelibguid values, which often indicate reconnaissance or post-exploitation activities within an Azure environment. Proactively hunting for these specific tool signatures in Azure Sentinel is critical to distinguish legitimate security operations from malicious actors leveraging similar frameworks to establish persistence or evade standard detection rules.
rule HKTL_NET_GUID_ReverseShell {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/chango77747/ReverseShell"
author = "Arnim Rupp"
date = "2020-12-13"
strings:
$typelibguid0 = "980109e4-c988-47f9-b2b3-88d63fababdc" ascii nocase wide
$typelibguid1 = "8abe8da1-457e-4933-a40d-0958c8925985" 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 4 specific false positive scenarios for the rule “Detects c# red/blue-team tools via typelibguid” in an enterprise environment, along with suggested filters:
Scenario: Automated Office Add-in Deployment
msiexec.exe or setup.exe running under a known service account (e.g., DOMAIN\svc_deploy) and the TypeLib GUID matches the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.Scenario: Endpoint Detection and Response (EDR) Self-Updates
C:\Program Files\CrowdStrike\csagent.exe or C:\Windows\System32\MsMpEng.exe) and whitelist their associated TypeLib GUIDs which are static across the fleet.Scenario: Scheduled PowerShell Script Execution
System.Reflection to interact with local system components, generating TypeLib GUID events that resemble active threat