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):
Imagine if you had a super-powered assistant who could automatically handle all the boring, repetitive…
Managing files efficiently is a core skill for anyone working in Linux, whether you're a…
Open ports act as communication endpoints between your Linux system and the outside world. Every…
Introduction In today’s cyber threat landscape, protecting endpoints such as computers, smartphones, and tablets from…
Introduction In today's fast-paced cybersecurity landscape, incident response is critical to protecting businesses from cyberattacks.…
Artificial Intelligence (AI) is changing how industries operate, automating processes, and driving new innovations. However,…