Using CredEnumerate to pull WebCredentials

2020-04-19 04:46发布

问题:

As part of a password management tool, I am attempting to enumerate IE 10 web site usernames (i.e., auto-complete usernames) by using CredEnumerate. When I call CredEnumerate, it yields several usernames (generic usernames and domain usernames) from within the "Windows Credentials" section of the "Credential Manager", but does not include anything from the "Web Credentials" section of the Credential Manager (Control Panel\User Accounts and Family Safety\Credential Manager).

private static void Main()
{
    int count;
    IntPtr pCredentials;
    bool ret = CredEnumerate(null, 1, out count, out pCredentials);
    // ...
}

How can I get access to the Web Credentials?

回答1:

The simplest solution is to use the password vault, Windows.Security.Credentials.PasswordVault . Of course, this namespace is Windows 8 specific.