Question

I am trying to write a simple C# program to capture password change events using Microsoft's dll "passfilt.dll". I read about the functions provided by it. I just used "InitializeChangeNotify" and its returning true. Now how would I use the "PasswordChangeNotify" method and get the password as plaintext?? Here is my code !

using System.Text;
using System.Runtime.InteropServices;
class Program
    {


     [DllImport("passfilt.dll" ,EntryPoint="#1" )]
        public extern static Boolean InitializeChangeNotify();


        static void Main(string[] args)
        {

            Boolean ans= InitializeChangeNotify();
            Console.WriteLine("Answer " + ans);
            Console.ReadKey();

        }
    }

Note: I am new to C#. I couldn't find any sample prog for this. Help me out!

Was it helpful?

Solution

You cannot use passfilt.dll to capture password change events. The dll is a filter used by Windows to check the quality of a password.

The filter contains three functions that are called in sequence (InitializeChangeNotify, PasswordFilter and PasswordChangeNotify). The first is used to initialize the filter, the second is used to check the quality of a password, the last is used to notify the dll that Windows has changed the password. All functions are called by Windows.

You can call the functions as well but you cannot use PasswordChangeNotify to capture password change events.

If you want to capture password change events, you'll have to write a filter yourself and install it on your machine. Then Windows will call PasswordChangeNotify to let you know a password has changed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top