Cross-source coverage
T1574.012 / ATT&CK
Hijack Execution Flow: COR_PROFILER
2 rules across 1 source.
From MITRE ATT&CK 19.2
Adversaries may leverage the COR_PROFILER environment variable to hijack the execution flow of programs that load the.NET CLR. The COR_PROFILER is a.NET Framework feature which allows developers to specify an unmanaged (or external of.NET) profiling DLL to be loaded into each.NET process that loads the Common Language Runtime (CLR). These profilers are designed to monitor, troubleshoot, and debug managed code executed by the.NET CLR.
The COR_PROFILER environment variable can be set at various scopes (system, user, or process) resulting in different levels of influence. System and user-wide environment variable scopes are specified in the Registry, where a Component Object Model (COM) object can be registered as a profiler DLL. A process scope COR_PROFILER can also be created in-memory without modifying the Registry. Starting with.NET Framework 4, the profiling DLL does not need to be registered as long as the location of the DLL is specified in the COR_PROFILER_PATH environment variable.
Adversaries may abuse COR_PROFILER to establish persistence that executes a malicious DLL in the context of all.NET processes every time the CLR is invoked. The COR_PROFILER can also be used to elevate privileges (ex: Bypass User Account Control) if the victim.NET process executes at a higher permission level, as well as to hook and impair defenses provided by.NET processes.
- Platforms
- Windows
- Telemetry
-
WinEventLog:SecurityWinEventLog:Sysmon
How MITRE says to detect it DET0479
Detection Strategy for Hijack Execution Flow using the Windows COR_PROFILER.
Windows Analytic 1319
Modification of COR_PROFILER-related environment variables or Registry keys (COR_ENABLE_PROFILING, COR_PROFILER, COR_PROFILER_PATH), combined with anomalous.NET process creation or unmanaged DLL loads. Defender observes registry modifications, suspicious process creation with altered environment variables, and profiler DLLs loaded unexpectedly into.NET CLR processes.
WinEventLog:SecurityEventCode=4657WinEventLog:SysmonEventCode=1WinEventLog:SysmonEventCode=7WinEventLog:SysmonEventCode=11
SigmaHQ/sigma
2 rules| Detection | Severity | Format |
|---|---|---|
| Enabling COR Profiler Environment Variables | Medium | Sigma |
| Registry-Free Process Scope COR_PROFILER | Medium | Sigma |