This rule identifies potential adversary activity by detecting C#-based red and black team tools through their unique TypeLibGUID signatures within Azure Sentinel logs. Proactive hunting for these specific identifiers is essential to distinguish legitimate security testing from malicious reconnaissance or tool deployment that may otherwise evade standard signature-based detections.
rule HKTL_NET_GUID_PortTran {
meta:
description = "Detects c# red/black-team tools via typelibguid"
reference = "https://github.com/k8gege/PortTran"
author = "Arnim Rupp"
date = "2020-12-29"
strings:
$typelibguid0 = "3a074374-77e8-4312-8746-37f3cb00e82c" ascii nocase wide
$typelibguid1 = "67a73bac-f59d-4227-9220-e20a2ef42782" 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 “Detects C# Red/Black-Team Tools via TypelibGUID” rule, including suggested filters and exclusions:
Scenario: Automated Build Pipelines (Jenkins/GitLab CI)
msbuild.exe or custom build agents that load specific .NET assemblies. These processes often instantiate the same TypelibGUIDs used by security tools during the build phase, triggering alerts on build nodes.Jenkins, GitLab Runner) or filter by process path containing \build\ or \agent\. Additionally, add a time-based exclusion for known maintenance windows (e.g., 02:00–04:00 UTC).Scenario: Microsoft Defender for Endpoint (MDE) Self-Scanning
MsMpEng.exe and SenseService.exe. Alternatively, exclude events where the parent process is the MDE sensor itself to prevent recursive detection.Scenario: Office 365 ProPlus Background Updates
OfficeClickToRun.exe or UpdateService.exe) that load C# components for license verification and feature installation. These components utilize standard .NET TypelibGUIDs that overlap with the detection logic for security tools.