This hunt hypothesis 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 team to distinguish between legitimate security testing operations and suspicious tool usage that may signal an attacker leveraging similar frameworks to establish persistence or conduct reconnaissance.
rule HKTL_NET_GUID_SharpAttack {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/jaredhaight/SharpAttack"
author = "Arnim Rupp"
date = "2020-12-28"
strings:
$typelibguid0 = "5f0ceca3-5997-406c-adf5-6c7fbb6cba17" 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/black-team tools via typelibguid”, including suggested filters and exclusions:
Scenario: Automated CI/CD Pipeline Execution
dotnet CLI or MSBuild.exe. These tools often instantiate .NET assemblies that generate specific TypeLibGUIDs associated with the build environment rather than an active Red Team attack.NT SERVICE\Jenkins, SYSTEM) where the parent process is a known CI/CD orchestrator (jenkins.exe, azagentworker.exe) and the file path resides within the build agent directory (e.g., C:\Program Files\Microsoft\Visual Studio\...).Scenario: Scheduled Office 365 ProPlus Updates
OfficeClickToRun.exe) or scheduled update tasks utilize C# components to manage add-ins and registry keys. These operations trigger TypeLibGUIDs that mimic those used by reconnaissance tools like SharpHound or Bloodhound.OfficeClickToRun.exe, msiexec.exe (with command line containing /quiet /passive), and the TypeLibGUID belongs to known Microsoft Office GUIDs (e.g., {000209FF-0000-0000-C000-000000000046}).Scenario: Enterprise Endpoint Protection Scans