Adversaries may establish persistence and/or elevate privileges by executing malicious content triggered by AppCert DLLs loaded into processes. Dynamic-link libraries (DLLs) that are specified in the AppCertDLLs Registry key under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager</code> are loaded into every process that calls the ubiquitously used application programming interface (API) functions CreateProcess, CreateProcessAsUser, CreateProcessWithLoginW, CreateProcessWithTokenW, or WinExec.
Similar to Process Injection, this value can be abused to obtain elevated privileges by causing a malicious DLL to be loaded and run in the context of separate processes on the computer. Malicious AppCert DLLs may also provide persistence by continuously being triggered by API activity.
Kill Chain Phase
- Privilege Escalation (TA0004)
- Persistence (TA0003)
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: Create registry persistence via AppCert DLL
Creates a new 'AtomicTest' value pointing to an AppCert DLL in the AppCertDlls registry key.
Once the computer restarted, the DLL will be loaded in multiple processes and write an
'AtomicTest.txt' file in C:\Users\Public\ to validate that the DLL executed succesfully.
Reference: https://skanthak.homepage.t-online.de/appcert.html
Supported Platforms: windows
Elevation Required: Yes
Copy-Item "#{dll_path}" C:\Users\Public\AtomicTest.dll -Force
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\AppCertDlls" /v "AtomicTest" /t REG_EXPAND_SZ /d "C:\Users\Public\AtomicTest.dll" /f
if(#{reboot}){Restart-Computer}
Dependencies:
- File to copy must exist on disk at specified location (#{dll_path})
Manual Testing
If Atomic Red Team tests are not applicable, manually verify the technique by:
-
Identify Attack Surface: Determine if the target environment is susceptible to AppCert DLLs by examining the target platforms (Windows).
-
Assess Existing Defenses: Review whether mitigations for T1546.009 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
-
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Remediation Guide
M1038 Execution Prevention
Adversaries install new AppCertDLL binaries to execute this technique. Identify and block potentially malicious software executed through AppCertDLLs functionality by using application control tools, like Windows Defender Application Control, AppLocker, or Software Restriction Policies where appropriate.
Detection
Detection Strategy for AppCert DLLs Persistence via Registry Injection
Risk Assessment
| Finding | Severity | Impact |
|---|
| AppCert DLLs technique applicable | High | Privilege Escalation |
CWE Categories
| CWE ID | Title |
|---|
| CWE-269 | Improper Privilege Management |
References