Hijack Execution Flow: COR_PROFILER
- ID
- T1574.012
- Tactics
- TA0002 Execution, TA0005 Stealth
- Sub-technique of
- T1574 Hijack Execution Flow
- Platforms
- Windows
- Data sources
- Windows Registry Key Modification, Process Creation, Module Load, File Creation
- Source
- attack.mitre.org
- MITRE last modified
- 12 May 2026
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.[4][5]
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.[5]
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.[6][7][8][9][10]
Detection
- DET0479 Detection Strategy for Hijack Execution Flow using the Windows COR_PROFILER.
Data components: Windows Registry Key Modification, Process Creation, Module Load, File Creation
Mitigations (3)
- M1018 User Account Management
Limit the privileges of user accounts so that only authorized administrators can edit system environment variables.
- M1024 Restrict Registry Permissions
Ensure proper permissions are set for Registry hives to prevent users from modifying keys associated with COR_PROFILER.
- M1038 Execution Prevention
Identify and block potentially malicious unmanaged COR_PROFILER profiling DLLs by using application control solutions like AppLocker that are capable of auditing and/or blocking unapproved DLLs.[1][2][3]
