问题广告密码过滤DLL实现

发布于 2025-02-06 14:06:00 字数 1406 浏览 0 评论 0原文

我在为我的广告实现密码过滤器DLL时遇到了问题,因此我将其减少到下面的代码中所示,当用户更改密码时,它仍然不起作用,因为我遇到了此错误:“无法更新密码。

Voici Mon Fichier dllmain.cpp

#include "pch.h"
#include <SDKDDKVer.h>
#include <windows.h>
#include <stdio.h>
#include <ntsecapi.h>

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}



__declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void)
{
   return TRUE;
}


__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(
    PUNICODE_STRING AccountName,
    PUNICODE_STRING FullName,
    PUNICODE_STRING Password,
    BOOLEAN SetOperation
)
{
    return TRUE;
}


__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(
    PUNICODE_STRING UserName,
    ULONG RelativeId,
    PUNICODE_STRING NewPassword
)
{
    return 0;
}

我用 Visual Studio 2022 编译DLL,然后将其发送到c:\ Windows \ System32中的AD中。然后,我添加System \\ currentControlset \\ Control \\ LSA的subkey 通知软件包在我的dll的名称中。最后我重新启动了广告。

我认为我已经最小化了代码,但仍然返回“ True”,但它仍然不起作用...

I have problems implementing a password filter DLL for my AD so I reduced it to the minimum as shown in the code below and when a user changes the password, it still doesn't work because I get this error : "Unable to update the password. The value provided for the new password doest not meet the length, complexity, or history requirements of the domain".

Voici mon fichier dllmain.cpp :

#include "pch.h"
#include <SDKDDKVer.h>
#include <windows.h>
#include <stdio.h>
#include <ntsecapi.h>

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}



__declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void)
{
   return TRUE;
}


__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(
    PUNICODE_STRING AccountName,
    PUNICODE_STRING FullName,
    PUNICODE_STRING Password,
    BOOLEAN SetOperation
)
{
    return TRUE;
}


__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(
    PUNICODE_STRING UserName,
    ULONG RelativeId,
    PUNICODE_STRING NewPassword
)
{
    return 0;
}

I compile my DLL with Visual Studio 2022 then I send it to my AD in C:\Windows\System32. Then I add in the subkey Notification Packages of SYSTEM\\CurrentControlSet\\Control\\Lsa in Regedit the name of my DLL. Then finally I reboot the AD.

I think I have minimized the code and still returns "True" but it still doesn't work...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文