Created
September 10, 2018 11:49
-
-
Save maldevel/acd68e47a6e8f367e37487858407316d to your computer and use it in GitHub Desktop.
PassCat Reading Internet Explorer - Vault files passwords snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/twelvesec/passcat | |
//GNU General Public License v3.0 | |
//@maldevel | |
//... | |
void libvaultie::print_vault_ie_passwords(void) { | |
if (!initialized) return; | |
DWORD vaultsCounter, itemsCounter; | |
LPGUID vaults; | |
HVAULT hVault; | |
PVOID items; | |
PVAULT_ITEM items8, pItem; | |
if (pVaultEnumerateVaults(NULL, &vaultsCounter, &vaults) != ERROR_SUCCESS) { | |
return; | |
} | |
for (DWORD i = 0;i < vaultsCounter;i++) { | |
if (pVaultOpenVault(&vaults[i], 0, &hVault) == ERROR_SUCCESS) { | |
if (pVaultEnumerateItems(hVault, VAULT_ENUMERATE_ALL_ITEMS, &itemsCounter, &items) == ERROR_SUCCESS) { | |
items8 = (PVAULT_ITEM)items; | |
for (DWORD j = 0; j < itemsCounter; j++) { | |
std::wcout << "URL: " << items8[j].Resource->data.String << std::endl; | |
std::wcout << "Username: " << items8[j].Identity->data.String << std::endl; | |
pItem = NULL; | |
if (pVaultGetItem(hVault, &items8[j].SchemaId, items8[j].Resource, items8[j].Identity, items8[j].PackageSid, NULL, 0, &pItem) == 0) { | |
if (pItem->Authenticator != NULL && pItem->Authenticator->data.String != NULL) { | |
std::wcout << "Password: " << pItem->Authenticator->data.String << std::endl; | |
} | |
pVaultFree(pItem); | |
} | |
std::wcout << std::endl; | |
} | |
pVaultFree(items); | |
std::wcout << std::endl; | |
} | |
pVaultCloseVault(&hVault); | |
} | |
} | |
if (vaults) | |
{ | |
pVaultFree(vaults); | |
vaults = NULL; | |
} | |
} | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment