Detect AppCert DLLs in Google Chronicle
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 HKLM\System\CurrentControlSet\Control\Session Manager are loaded into every process that calls the commonly used application programming interface (API) functions CreateProcess, CreateProcessAsUser, CreateProcessWithLoginW, CreateProcessWithTokenW, or WinExec. This provides adversaries a way to have code execute in the security context of every process on the system, including processes with high privilege levels.
MITRE ATT&CK
- Tactic
- Privilege Escalation Persistence
- Technique
- T1546 Event Triggered Execution
- Sub-technique
- T1546.009 AppCert DLLs
- Canonical reference
- https://attack.mitre.org/techniques/T1546/009/
YARA-L Detection Query
rule appcert_dll_persistence_t1546_009 {
meta:
author = "Argus Detection Platform"
description = "Detects AppCert DLL persistence and privilege escalation via registry modification of AppCertDlls key with non-system DLL paths, or suspicious DLL module loads from non-standard directories triggered by the AppCert mechanism"
mitre_attack_tactic = "Persistence, Privilege Escalation"
mitre_attack_technique = "T1546.009"
severity = "HIGH"
confidence = "HIGH"
reference = "https://attack.mitre.org/techniques/T1546/009/"
events:
(
$e.metadata.event_type = "REGISTRY_MODIFICATION" and
re.regex($e.target.registry.registry_key,
`(?i)\\System\\CurrentControlSet\\Control\\Session Manager\\AppCertDlls`) and
not re.regex($e.target.registry.registry_value_data,
`(?i)^C:\\Windows\\(system32|SysWOW64|WinSxS)\\`)
) or
(
$e.metadata.event_type = "PROCESS_MODULE_LOAD" and
re.regex($e.target.file.full_path, `(?i)appcert`) and
not re.regex($e.target.file.full_path,
`(?i)C:\\Windows\\(system32|SysWOW64|WinSxS)\\`)
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting AppCert DLL persistence (T1546.009) by monitoring UDM REGISTRY_MODIFICATION events targeting the Session Manager AppCertDlls key where the registered DLL path is outside system directories, and PROCESS_MODULE_LOAD events where a DLL with 'appcert' in its path is loaded from a non-system location. Covers both the write (persistence establishment) and execute (DLL injection into all new processes) phases of the technique.
Data Sources
Required Tables
False Positives & Tuning
- Security monitoring solutions from vendors who register inspection DLLs outside system32 in AppCertDlls for kernel-level process monitoring capabilities
- Microsoft Application Compatibility Toolkit (ACT) or third-party app-compat shim tooling that writes non-system DLL paths to AppCertDlls as part of shim database deployment
- Enterprise DLP or insider-threat monitoring agents installed in custom directories that hook process creation via AppCertDlls to inspect all spawned processes
Other platforms for T1546.009
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Register DLL in AppCertDlls Registry Key
Expected signal: Sysmon Event ID 13: TargetObject=HKLM\System\CurrentControlSet\Control\Session Manager\AppCertDlls\ArgusTestDll, Details=C:\Users\Public\argus_appcert_test.dll. Security Event ID 4657 if registry auditing enabled.
- Test 2Query Existing AppCertDlls Registrations
Expected signal: Process creation for reg.exe with query arguments for the AppCertDlls key. Registry access events if object access auditing is enabled. The output reveals all currently registered DLLs.
- Test 3Create and Register AppCert DLL for Process Injection
Expected signal: File creation event for argus_appcert.dll in Public folder. Sysmon Event ID 13 for AppCertDlls registry key modification. Subsequently, Sysmon Event ID 7 records showing the DLL loaded by various processes that call CreateProcess (e.g., cmd.exe spawning children).
References (4)
- https://attack.mitre.org/techniques/T1546/009/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.009/T1546.009.md
- https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-windows
- https://pentestlab.blog/2019/12/16/persistence-appcert-dlls/
Unlock Pro Content
Get the full detection package for T1546.009 including response playbook, investigation guide, and atomic red team tests.