| name | T1574.012_corprofiler |
| description | Adversaries may leverage the COR_PROFILER environment variable to hijack the execution flow of programs that load the .NET CLR. |
| category | configuration |
| version | 18.1 |
| author | cyberstrike-official |
| tags | ["mitre-attack","enterprise","t1574.012","persistence","privilege-escalation","defense-evasion","windows","sub-technique"] |
| technique_id | T1574.012 |
| tactic | persistence |
| all_tactics | ["persistence","privilege-escalation","defense-evasion"] |
| platforms | ["Windows"] |
| mitre_url | https://attack.mitre.org/techniques/T1574/012 |
| tech_stack | ["windows"] |
| cwe_ids | ["CWE-276"] |
| chains_with | ["T1574","T1574.001","T1574.004","T1574.005","T1574.006","T1574.007","T1574.008","T1574.009","T1574.010","T1574.011","T1574.013","T1574.014"] |
| prerequisites | ["T1574"] |
| severity_boost | {"T1574":"Chain with T1574 for deeper attack path","T1574.001":"Chain with T1574.001 for deeper attack path","T1574.004":"Chain with T1574.004 for deeper attack path"} |
T1574.012 COR_PROFILER
Sub-technique of: T1574
High-Level Description
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.
Kill Chain Phase
- Persistence (TA0003)
- Privilege Escalation (TA0004)
- Defense Evasion (TA0005)
Platforms: Windows
What to Check
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: User scope COR_PROFILER
Creates user scope environment variables and CLSID COM object to enable a .NET profiler (COR_PROFILER).
The unmanaged profiler DLL (T1574.012x64.dll) executes when the CLR is loaded by the Event Viewer process.
Additionally, the profiling DLL will inherit the integrity level of Event Viewer bypassing UAC and executing with high integrity.
If the account used is not a local administrator the profiler DLL will still execute each time the CLR is loaded by a process, however,
the notepad process will not execute with high integrity.