This detection rule identifies the execution of known .NET-based Red and Blue team utility names to distinguish legitimate security operations from potential adversary tooling that mimics these signatures. Proactive hunting for this behavior in Azure Sentinel is essential to validate authorized internal activities and uncover stealthy adversaries leveraging familiar .NET tools to evade standard signature-based defenses.
rule HKTL_NET_NAME_RunasCs {
meta:
description = "Detects .NET red/black-team tools via name"
reference = "https://github.com/antonioCoco/RunasCs"
author = "Arnim Rupp"
date = "2021-01-22"
strings:
$name = "RunasCs" 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 backup jobs utilizing Veeam Backup & Replication or Commvault. These enterprise-grade solutions often spawn .NET processes (e.g., Veeam.Backup.Service.exe, commvault.cmd) that match the naming patterns of red-team tools like Cobalt Strike’s Beacon or custom C# implants.
C:\Program Files\Veeam\ or C:\CommServe\, ensuring only known backup infrastructure triggers are bypassed.Scenario: Scheduled maintenance tasks running Microsoft System Center Configuration Manager (SCCM) or Intune Management Extension. These tools frequently execute .NET agents to deploy patches and inventory hardware, often naming processes generically (e.g., ccmexec.exe, TaskSchedulerAgent.exe) which can overlap with the detection logic for black-team reconnaissance tools.
ccmexec.exe or msiexec.exe, suppress alerts generated by child .NET tools during these hours.Scenario: Internal DevOps pipelines executing .NET Core build agents (e.g., Jenkins, Azure DevOps Agents) on build servers. These agents often run custom C# scripts for code analysis and dependency scanning that mimic the behavior of red-team tooling suites like SharpChisel or PowerSploit.