GithubHelp home page GithubHelp logo

iqinit / openpasswordfilter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amarkulo/openpasswordfilter

0.0 2.0 0.0 62.87 MB

An open source custom password filter DLL and userspace service to better protect / control Active Directory domain passwords.

License: GNU General Public License v2.0

C# 63.56% C++ 33.04% C 3.41%

openpasswordfilter's Introduction

Introduction

OpenPasswordFilter is an open source custom password filter DLL and userspace service to better protect / control Active Directory domain passwords.

Troy Hunt has wrote a blog post where he published 324+ millions of password hashes from breaches in past, so what I did is that I took those files, loaded them in SQL database and modified OPF to query those instead of password lists as in the original project.

I have added configuration options in OPFilterService.config so you can configure OPF to use either of those, enable logging, etc.

You can find the original project tree here.

Accompanied blog post about installation and more detailed instructions can be found on my blog.

About OPF

Here is the descriptive part of readme from the original project.

The genesis of this idea comes from conducting many penetration tests where organizations have users who choose common passwords and the ultimate difficulty of controlling this behavior. The fact is that any domain of size will have some user who chose Password1 or Summer2015 or Company123 as their password. Any intruder or low-privilege user who can guess or obtain usernames for the domain can easily run through these very common passwords and start expanding the level of access in the domain.

Microsoft provides a wonderful feature in Active Directory, which is the ability to create a custom password filter DLL. This DLL is loaded by LSASS on boot (if configured), and will be queried for each new password users attempt to set. The DLL simply replies with a TRUE or FALSE, as appropriate, to indicate that the password passes or fails the test.

There are some commercial options, but they are usually in the "call for pricing" category, and that makes it a little prohibitive for some organizations to implement truly effective preventive controls for this class of very common bad passwords.

This is where OpenPasswordFilter comes in -- an open source solution to add basic dictionary-based rejection of common passwords.

OPF is comprised of two main parts:

  1. OpenPasswordFilter.dll -- this is a custom password filter DLL that can be loaded by LSASS to vet incoming password changes.
  2. OPFService.exe -- this is a C#-based service binary that provides a local user-space service for maintaining the dictionary and servicing requests.

The DLL communicates with the service on the loopback network interface to check passwords against the configured database of forbidden values. This architecture is selected because it is difficult to reload the DLL after boot, and administrators are likely loathe to reboot their DCs when they want to add another forbidden password to the list. Just bear in mind how this architecture works so you understand what's going on.

NOTE The current version is very ALPHA! I have tested it on some of my DCs, but your mileage may vary and you may wish to test in a safe location before using this in real life.

Installation

You can download a precompiled 32 and 64-bit version of OPF from the following links:

File MD5 sum SHA1 sum
x64.7z 69aeafa5a543f28a542345e621c1b8ab 8af16eafa2d9b136b3d77ae4b380667f498b3d17
x86.7z 48dd6bc5980201e8e20aabfcf89d1d70 67f9e18ba974b6fdf60fd64252438c5e0e0cb8f5

Please verify hashes before putting them on your servers.

TL;DR:

  1. Copy complete release catalog to some place on disk
  2. Run \windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe OPFService.exe command to install the service
  3. Start the service
  4. Copy OpenPasswordFilter.dll to %WINDIR%\System32
  5. Validate that HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Notification Packages registry key contains OpenPasswordFilter value
  6. Configure SQL settings in app.config
  7. Start the service and test if it works with provided OPFTest.exe which queries service using OpenPasswordFilter.dll
  8. Restart the DC server so changes to LSA takes place
  9. Repeat for the rest of your DC servers

If all has gone well, test by using the normal GUI password reset function (ctrl+alt+del) to choose a password that is on your forbidden list. If not enable logging by setting OPFLoggingEnabled to true in OPFService.config, restart the service and check logs for errors.

P.S.

In case you decide to recompile the project and change OPFClientRecognitionKeyword you will need to change value of line 96 in dllmain.cpp to match the new keyword.

Links

openpasswordfilter's People

Contributors

amarkulo avatar brockrob avatar jamlamberti avatar jephthai avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.