This rule identifies the execution of known .NET-based red and black team tools by matching process names against a curated list of security testing utilities. Proactive hunting for these artifacts in Azure Sentinel is essential to distinguish legitimate security assessments from potential adversary activity that mimics tooling behavior to evade detection or establish persistence.
rule HKTL_NET_NAME_ADCollector {
meta:
description = "Detects .NET red/black-team tools via name"
reference = "https://github.com/dev-2null/ADCollector"
hash = "5391239f479c26e699b6f3a1d6a0a8aa1a0cf9a8"
hash = "9dd0f322dd57b906da1e543c44e764954704abae"
author = "Arnim Rupp"
date = "2021-01-22"
strings:
$name = "ADCollector" ascii wide
$compile = "AssemblyTitle" ascii wide
condition:
(uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550) and all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the rule “Detects .NET red/black-team tools via name,” along with suggested filters or exclusions:
Scenario: Automated Backup Jobs Using PowerShell
System.Data.SqlClient or generic .exe names that overlap with red-team tool signatures like SharpUp or PowerShell Empire.Veeam, Commvault, or specific backup service folders (e.g., C:\Program Files\Veeam\Backup and Replication). Additionally, filter out processes where the parent is a known backup service account (e.g., NT SERVICE\VeeamBRService).Scenario: Internal Development Build Pipelines
msbuild.exe, dotnet.exe, or internal custom automation scripts. These often mimic the naming conventions of red-team tools such as SharpChmod or PowerShell Empire.C:\AzureDevOps\Agent). Filter out events where the command line contains keywords like --restore, publish, or build.Scenario: Endpoint Management and Patching Agents