MITRE ATT&CKsub-technique
T1574.012 COR_PROFILER
- Domain
- enterprise
- Tactics
- Stealth, Execution
- Platforms
- Windows
- Version
- 2.0
- Created
- 2020-06-24
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.
Related
Subtechnique of · MITRE ATT&CK (1)
- T1574 Hijack Execution Flow technique
Referenced by MITRE ATT&CK · mitigates (3)
Referenced by MITRE ATT&CK · uses (2)
Referenced by Compliance · mitigates (11)
- CIS-2.6 Allowlist Authorized Libraries CIS Safeguard v8.1
- CIS-6.8 Define and Maintain Role-Based Access Control CIS Safeguard v8.1
- NIST-AC-2 Account Management NIST 800-53 control
- NIST-AC-3 Access Enforcement NIST 800-53 control
- NIST-AC-5 Separation of Duties NIST 800-53 control
- NIST-AC-6 Least Privilege NIST 800-53 control
- NIST-CM-5 Access Restrictions for Change NIST 800-53 control
- NIST-CM-7 Least Functionality NIST 800-53 control
- NIST-IA-2 Identification and Authentication (Organizational Users) NIST 800-53 control
- NIST-SI-10 Information Input Validation NIST 800-53 control
- NIST-SI-7 Software, Firmware, and Information Integrity NIST 800-53 control
References
- https://offsec.almond.consulting/UAC-bypass-dotnet.html Almond COR_PROFILER Apr 2019
- https://redcanary.com/blog/cor_profiler-for-persistence/ Red Canary COR_PROFILER May 2020
- https://redcanary.com/blog/blue-mockingbird-cryptominer/ RedCanary Mockingbird May 2020
- https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ee471451(v=vs.100) Microsoft COR_PROFILER Feb 2013
- https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/profiling-overview Microsoft Profiling Mar 2017
- https://web.archive.org/web/20170720041203/http://subt0x10.blogspot.com/2017/05/subvert-clr-process-listing-with-net.html subTee .NET Profilers May 2017
- https://github.com/OmerYa/Invisi-Shell GitHub OmerYa Invisi-Shell