This rule identifies the execution of known .NET-based Red and Black team utility names to distinguish legitimate security testing activities from potential adversary tool usage. Proactive hunting for these indicators in Azure Sentinel is essential to differentiate between authorized internal assessments and suspicious external reconnaissance that may mimic similar tool signatures.
rule HKTL_NET_NAME_DotNetInject {
meta:
description = "Detects .NET red/black-team tools via name"
reference = "https://github.com/dtrizna/DotNetInject"
author = "Arnim Rupp"
date = "2021-01-22"
strings:
$name = "DotNetInject" 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/blue-team tools via name,” including suggested filters and exclusions:
Scenario: Legitimate automated deployment pipelines executing Octopus.Tentacle.exe or Azure DevOps Agent (Microsoft.TeamFoundation.Build.Agent.Worker.exe) on build servers.
Octopus.Tentacle.exe, VSTestRunner.exe) running under the service account context (e.g., NT SERVICE\BuildAgent or SYSTEM) within the “DevOps” security group.Scenario: Scheduled maintenance tasks utilizing Microsoft.PowerShell.CoreCLR.v4.dll or System.Diagnostics.Process to run internal .NET-based health check scripts on domain controllers and file servers.
TaskHost.exe (Windows Task Scheduler) and the command line arguments contain specific keywords like “—health-check” or “—internal-monitoring,” provided the execution occurs during defined maintenance windows (e.g., 02:00–04:00).Scenario: Security teams running legitimate vulnerability scanning tools such as Tenable Nessus Agent or Qualys Cloud Agent, which often utilize .NET frameworks for their reporting modules.
C:\Program Files\Tenable\NessusAgent\ or C:\Qualys\PCAT\) to distinguish them from ad-hoc tool usage.Scenario: End-user productivity suites like Microsoft Teams, Zoom, or internal line-of-business applications (LOB) written in .NET that spawn helper processes matching the rule’s naming convention during user