Configure Additional LSA Protection to monitor Password Filter DLL

Onedaysec
4 min read
0 views
docx image 1770016179279 0 c9a46349fd

0x00 Preface

---

In response to wyzzoo's comment on the article 'Application of Password Filter DLL in Penetration Testing', reminding attention to issues to consider on higher version systems, the address is as follows:

An open-source project

Therefore, I conducted research on this part and compiled it into an article

0x01 Introduction

---

This article will cover the following:

  • How to configure additional LSA protection
  • How to obtain monitoring results
  • Supplement an exploitation idea for Password Filter DLL
  • Utilize the detection effectiveness of Additional LSA Protection

0x02 Configure additional LSA protection

---

Refer to official documentation:

https://docs.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection

Starting from Windows 8.1, additional protection is provided for LSA to prevent memory reading and code injection by unprotected processes

Protection method:

Requires any plugins loaded into LSA to be digitally signed with a Microsoft signature

Specifically, digital signature refers to catalog signature, which must meet WHQL certification

Reference materials:

https://docs.microsoft.com/zh-cn/windows-hardware/drivers/install/whql-release-signature

There is an article introducing catalog signature: 'CAT File Digital Signature Usage Tips'

Test system: Win8.1 x64

Configuration method:

1. The operating system must meet the conditions:

Windows 8.1 or newer systems

2. Modify the registry

Registry location HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LSASS.exe, create a new DWORD entry AuditLevel with value 00000008

The corresponding cmd command is as follows:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LSASS.exe" /v "AuditLevel" /t REG_DWORD /d "00000008" /f

3. Restart the system

0x03 Obtain monitoring results

---

View logs Event 3065 and Event 3066

Event 3065: This event records that a code integrity check determined a process (typically lsass.exe) attempted to load a specific driver that did not meet the security requirements for shared sections. However, the image was allowed to load due to configured system policies.

Event 3066: This event records that a code integrity check determined a process (typically lsass.exe) attempted to load a specific driver that did not meet Microsoft's signature level requirements. However, the image was allowed to load due to configured system policies.

Location: Applications and Services Logs\Microsoft\Windows\CodeIntegrity

Can log non-compliant DLLs but did not prevent the DLL from loading, as shown in the figure below

0x03 Obtain monitoring results — technical illustration 1

Query logs Event 3065 and Event 3066 via command line:

Get log category list:

wevtutil el >1.txt

Found that the corresponding entry for CodeIntegrity is Microsoft-Windows-CodeIntegrity/Operational

Search for Event 3065 and Event 3066:

wevtutil qe Microsoft-Windows-CodeIntegrity/Operational /rd:true /f:text /q:"*[system/eventid=3065 and 3066]"

As shown in the figure below

0x03 Obtain monitoring results — technical illustration 2

Supplement:

Delete CodeIntegrity logs:

wevtutil cl "Microsoft-Windows-CodeIntegrity/Operational"

0x04 Supplement: An exploitation approach for Password Filter DLL—achieving DLL "hiding" using Long UNC filename spoofing

---

For specific hiding details, refer to the article "Catalog Signature Forgery—Long UNC Filename Spoofing"

1. Name the DLL in Long UNC filename format and save it under %windir%\system32\

The lsass.exe process loads scecli.dll by default, so choose to disguise the DLL as scecli.dll

Command line:

type Win32Project3.dll > "\\?\C:\windows\system32\scecli.dll "

Note:

There is a space after the name scecli.dll

2. Obtain the short file name of the dll

Command line:

dir /x scecli*.dll

Obtain the short file name SCECLI~1.DLL, as shown in the figure below

2. Obtain the short file name of the dll — technical illustration 3

3. Modify the registry key value

Read the key value:

REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Notification Packages"

Add dll:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Notification Packages" /t REG_MULTI_SZ /d "scecli\0SCECLI~1.DLL" /f

4. Restart

Use Process Explorer to view the dlls loaded by the lsass process

Shows loading two identical scecli.dlls, with specific attribute differences, as shown in the figure below

4. Restart — technical illustration 4

5. Detection

Event 3066 successfully detected, as shown in the figure below

5. Detection — technical illustration 5

0x05 Supplement

---

1. Adding a forged Microsoft Authenticode signature to the Password Filter DLL and modifying the certificate verification mechanism to make it effective still cannot bypass Additional LSA Protection monitoring, because the Password Filter DLL requires a legitimate catalog signature, not an Authenticode signature

2. Creating a catalog signature for the Password Filter DLL and adding it to the system's security catalog database still cannot bypass Additional LSA Protection monitoring

0x06 Summary

---

This article introduces the method and detection effectiveness of configuring Additional LSA Protection to monitor Password Filter DLLs. If the Password Filter DLL does not have a legitimate catalog signature, the system can successfully detect it, but by default, it will not prevent loading

Related Questions & Answers

Can a forged Microsoft Authenticode signature or a custom catalog signature allow a Password Filter DLL to bypass Additional LSA Protection?

No, neither a forged Authenticode signature nor a custom catalog signature added to the system's security catalog database can bypass Additional LSA Protection. The protection specifically requires a legitimate WHQL-certified catalog signature (not an Authenticode signature) for any DLL loaded into LSA. As noted in the article [Configure Additional LSA Protection to monitor Password Filter DLL](/news/configure-additional-lsa-protection-to-monitor-password-filter-dll), even if the DLL has a valid Authenticode signature, it will still be flagged by the Code Integrity check and logged as Event 3066.

What exploitation technique is demonstrated for hiding a Password Filter DLL, and does it evade Additional LSA Protection?

The technique involves using a Long UNC filename to disguise a malicious DLL as `scecli.dll` with a trailing space, causing it to be loaded alongside the legitimate `scecli.dll` by `lsass.exe`. The DLL is saved as `\?\C:\windows\system32\scecli.dll ` and its short name (SCECLI~1.DLL) is added to the `Notification Packages` registry value. While this achieves a form of DLL "hiding" in Process Explorer, Additional LSA Protection successfully detects the non-compliant DLL and logs Event 3066, as shown in the [Application of Password Filter DLL in Penetration Testing](/news/application-of-password-filter-dll-in-penetration-testing) article.

How can I monitor whether a Password Filter DLL is attempting to load without a valid Microsoft catalog signature?

After configuring Additional LSA Protection, the system logs Event ID 3065 and Event ID 3066 in the `Applications and Services Logs\Microsoft\Windows\CodeIntegrity` log. Event 3065 records a driver that did not meet shared section security requirements, while Event 3066 records a driver that did not meet Microsoft's signature level requirements—both indicate a non-compliant DLL was allowed to load due to policy. You can query these events using `wevtutil qe Microsoft-Windows-CodeIntegrity/Operational /rd:true /f:text /q:"*[system/eventid=3065 and 3066]"`. The original article [Configure Additional LSA Protection to monitor Password Filter DLL](/news/configure-additional-lsa-protection-to-monitor-password-filter-dll) provides full details.

What is Additional LSA Protection and how do you configure it on Windows?

Additional LSA Protection is a security feature introduced in Windows 8.1 that prevents unsigned code from being loaded into the Local Security Authority (LSA) process. To configure it, you set the registry key `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LSASS.exe` with a DWORD value `AuditLevel` set to `00000008`, then restart the system. This is detailed in the article [Configure Additional LSA Protection to monitor Password Filter DLL](/news/configure-additional-lsa-protection-to-monitor-password-filter-dll).

Continue Reading