ryanries / PassFiltEx

PassFiltEx. An Active Directory Password Filter.
GNU General Public License v3.0
264 stars 50 forks source link
GitHub all releases

PassFiltEx.c

PassFiltEx by Joseph Ryan Ries

Author: Joseph Ryan Ries 2019-2024 ryanries09@gmail.com,ryan.ries@microsoft.com

A password filter for Active Directory that uses a blacklist of bad passwords/character sequences.

Technical Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/ms721882(v=vs.85).aspx


READ ME

This is a personal project and is NOT endorsed or supported by Microsoft in any way.

Use at your own risk. This code is not guaranteed to be free of errors, and comes

with no guarantees, liability, warranties or support.


Installation:

files

regedit

Operation:

regedit

BlacklistFileName allows you to specify a custom path to a blacklist file. By default if there is nothing specified, it is PassFiltExBlacklist.txt. The current working directory of the password filter is %SystemRoot%\System32, but you can specify a fully-qualified path name too. Even a UNC path (such as something in SYSVOL) if you want. WARNING: You are responsible for properly setting the permissions on the blacklist file so that it may only be edited and viewed by authorized users. You can store the blacklist file in SYSVOL if you want, but you must ask yourself whether you want all Authenticated Users to have the ability to read your blacklist file.

TokenPercentageOfPassword allows you specify how much of the entire password must consist of the blacklisted token before the password change is rejected. The default is 60% if nothing is specified. The registry value is REG_DWORD, with the value 60 decimal representing 60%, which is converted to float 0 - 1.0 at runtime. For example, if the character sequence starwars appeared in the blacklist file, and TokenPercentageOfPassword was set to 60, then the password Starwars1! would be rejected, because more than 60% of the proposed password is made up of the blacklisted term starwars. However, the password starwars1!DarthVader88 would be accepted, because even though it contains the blacklisted sequence starwars, more than 60% of the proposed password is NOT starwars.

MinLower/MinUpper/etc. allows you to specify if you require the user's password to contain multiple instances of any given character class. For example setting MinDigit to 2 will require passwords to contain at least 2 digits.

BlockSequentialChars 0 means it is off, 1 means it is on. This will block sequences of characters such as 'abc' or '123'.

Debug 0 means it's off, 1 means it is on. If Debug is on, additional log messages will be written to the log file. If Debug is off, then only serious errors will be logged.

The debug log is \Windows\system32\PassFiltEx.log. A new log file is automatically started once the current log file reaches 1MB. By default, only error messages are logged. If the Debug registry setting is turned on, then additional informational messages will also be logged.

You can use the command "tasklist /m PassFiltEx.dll" to verify whether the module is indeed loaded into the lsass process. Certain security features such as RunAsPPL, antivirus, etc., might try to prevent lsass from loading the module.

tasklist

Coding Guidelines: