DLLPasswordFilterImplant is a custom password filter DLL that allows the capture of a user’s credentials. Each password change event on a domain will trigger the registered DLL in order to exfiltrate the username and new password value prior successfully changing it in the Active Directory (AD).
For more information about password filters consult the Microsoft documentation.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Notification Packages
subkey exists, add the name of the DLL (“DLLPasswordFilterImplant” if you didn’t rename it) to the existing value data. Do not overwrite the existing values..dll
extension when adding the name of the DLL in the Notification Packages
subkey.KEY=key.pem
# Generate an RSA key and dump its public key. Keep the private key around for decryption
openssl genrsa -out $KEY 2048
# Prepare the Windows registry key entry.
echo ‘Windows Registry Editor Version 5.00’ > addKey.reg
echo >> addKey.reg
echo ‘[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]’ >> addKey.reg
# If python2 does not exist, use python instead.
echo “Key=hex:$(openssl rsa -in $KEY -pubout | sed -E ‘/^-/d’ | base64 -d | python2 -c ‘import sys; print(“,”.join([“{:02x}”.format(ord(b)) for b in sys.stdin.read()]))’)” >> addKey.reg
addKey.reg
file to append the raw public key to the registry. Note that using asymmetric encryption significantly increases the size of the data to exfiltrate due to message padding. There are possible improvements to be made to reduce the data overhead.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Also Read – Rabid : Tool To Decode All Kind Of BigIP Cookies
Decrypting
The encrypted data is padded using OAEP and can be decrypted as follows:
# Convert the stitched hex string to raw bytes.
xxd -r -p exfiltrated.hex > raw.bin
# Decrypt using the private key.
openssl rsautl -decrypt -oaep -inkey $KEY -in raw.bin -out decrypted.txt
Uninstalling
To completely remove the password filter of a system:
HKEY_LOCAL_MACHINE SYSTEM\CurrentControlSet\Control\Lsa
A simple DNS server to receive the exfiltrated data is provided in scripts/
. Run pip install -r scripts/requirement.txt
, preferably in a virtual environment. and then provide it with a .PEM encoded private key and optional output file (defaults to creds.txt
) where to output the credentials.
Currently, the DNS server does not support concurrent password changes and serves only as a proof of concept. Pull requests adding robustness to the server are more than welcome.
Works on:
The password filter was tested exclusively on systems listed above.
Here are some tool that may help you debug the DLL (if necessary):
Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…
This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…
GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…
Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…
The free and open-source security platform SecHub, provides a central API to test software with…
Don't worry if there are any bugs in the tool, we will try to fix…