This rule identifies executable files that are compiled with the .NET framework, a common choice for adversaries to develop custom malware or implant tools due to its cross-platform capabilities and ease of development. Proactively hunting for these artifacts in Azure Sentinel allows the SOC to isolate and analyze potentially suspicious .NET binaries before they execute, helping to detect stealthy implants or post-exploitation tools that may blend in with legitimate application traffic.
rule IsNET_EXE : PECheck
{
condition:
pe.imports ("mscoree.dll","_CorExeMain")
}
This YARA rule can be deployed in the following contexts:
vstest.console.exe or msbuild.exe) executes .NET assemblies to compile and test code. This is a standard, high-frequency task in development environments.
VSTest.console.exe or MSBuild.exe, or filter by path containing \bin\ and *.dll in the command line arguments.powershell.exe to execute scripts that invoke .NET assemblies (e.g., System.Management.Automation or custom internal tools) for configuration management or reporting. The underlying host process may be identified as a .NET executable.
powershell.exe or pwsh.exe and the working directory is a known admin script repository (e.g., C:\Admin\Scripts\ or C:\Program Files\CorpTools\).sqlagent.exe or sqlservr.exe, or where the command line contains SQLCLR or references to specific database integration DLLs.