Skip to content

Instantly share code, notes, and snippets.

@PotatoPwn
Last active April 28, 2024 09:21
Show Gist options
  • Save PotatoPwn/7197a02839db3fb6b4a1e3db43d9623c to your computer and use it in GitHub Desktop.
Save PotatoPwn/7197a02839db3fb6b4a1e3db43d9623c to your computer and use it in GitHub Desktop.

Revisions

  1. PotatoPwn revised this gist Apr 28, 2024. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion PassFilter.cpp
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,10 @@ int main()
    Fullname = ConvertToPuni("You");
    Password = ConvertToPuni("Cunt");

    FilterPassword(AccountName, Fullname, Password, 0);
    bool Result = FilterPassword(AccountName, Fullname, Password, 0);

    printf("Password Strong > %s\n", Result ? "True" : "False");


    return 0;
    }
  2. PotatoPwn revised this gist Apr 28, 2024. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion PassFilter.cpp
    Original file line number Diff line number Diff line change
    @@ -24,8 +24,11 @@ PUNICODE_STRING ConvertToPuni(char* Character)

    int main()
    {
    // Passfilt.dll
    // Build Project in 32bit if using 32bit Passfilt.dll & ViseVersa

    _FilterPassword FilterPassword =
    reinterpret_cast<_FilterPassword>(GetProcAddress(LoadLibrary("PassFilter.dll"), "PasswordFilter"));
    reinterpret_cast<_FilterPassword>(GetProcAddress(LoadLibrary("Passfilt.dll"), "PasswordFilter"));


    PUNICODE_STRING AccountName, Fullname, Password;
  3. PotatoPwn created this gist Apr 28, 2024.
    38 changes: 38 additions & 0 deletions PassFilter.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    #include <iostream>
    #include <Windows.h>
    #include <SubAuth.h>

    using _FilterPassword = BOOLEAN(*)(PUNICODE_STRING AccountName, PUNICODE_STRING FullName, PUNICODE_STRING Password, BOOLEAN IsSet);


    PUNICODE_STRING ConvertToPuni(char* Character)
    {
    int Len = MultiByteToWideChar(CP_UTF8, 0, Character, -1, NULL, 0);

    PWSTR StringAlloc = static_cast<PWSTR>(LocalAlloc(LMEM_ZEROINIT, Len * sizeof(WCHAR)));

    MultiByteToWideChar(CP_UTF8, 0, Character, -1, StringAlloc, Len);

    PUNICODE_STRING Value = static_cast<PUNICODE_STRING>(LocalAlloc(LMEM_ZEROINIT, sizeof(UNICODE_STRING)));
    Value->Buffer = StringAlloc;
    Value->Length = Len;
    Value->MaximumLength = Len;

    return Value;
    }


    int main()
    {
    _FilterPassword FilterPassword =
    reinterpret_cast<_FilterPassword>(GetProcAddress(LoadLibrary("PassFilter.dll"), "PasswordFilter"));


    PUNICODE_STRING AccountName, Fullname, Password;
    AccountName = ConvertToPuni("Fuck");
    Fullname = ConvertToPuni("You");
    Password = ConvertToPuni("Cunt");

    FilterPassword(AccountName, Fullname, Password, 0);
    return 0;
    }