Re: How DPAPI decrypts the protected data when master key is deleted from machine?



Answers in-line.

"brijesh mishra" <mishra.brijesh@xxxxxxxxx> wrote in message
news:1187905075.230691.273950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I wonder how DPAPI finds the master key when you delete or rename
%USERPROFILE%\Application Data\Microsoft\Protect folder.

The master key is stored in User's profile along with Credential
History file at %USERPROFILE%\Application Data\Microsoft\Protect
folder. CredHist is located at the root of this folder and the master
key inside the subfolder names as the user's SID.

After renaming or deleting this ProtectFolder, CryptUnProtectData
method still decrypts your blob.

HOW IS THIS POSSIBLE? FROM WHERE MASTER KEY IS RETRIEVED for
decryption?
I can think of a couple of possibilities.

1. Master keys are cached in memory, so you'll need to reboot after renaming
or deleting the Protect folder.
2. For domain user accounts, master keys are backed up on the user's DC and
so the CryptUnprotectData function may just be calling over to the DC to get
the necessary key.


Also since Credential History is encrypted with password and contains
old password, it ought to be a big security hole in DPAPI
implementation unless the documentation is stating something that is
not TRUE.
Note that the CREDHIST file is only used for local accounts. Domain accounts
use backups on the DC instead.


DPAPI documentation says "the system keeps a "Credential History" file
in the user's profile directory. When a user changes his or her
password, the old password is added to the top of this file and then
the file is encrypted by the new password. If necessary, DPAPI will
use the current password to decrypt the "Credential History" file and
try the old password to decrypt the MasterKey. If this fails, the old
password is used to again decrypt the "Credential History" file and
the next previous password is then tried. This continues until the
MasterKey is successfully decrypted"

This means I simply have to hack into either SAM DB or PASSWORD cache
and I will be able to breach the MASTER key security.
If you are able to hack the system and obtain the user's plaintext password
then you can do anything you want, including decrypting the user's DPAPI
data. I wouldn't call this a security hole. If all you have is the user's
NTOWF, then this won't help you as the CREDHIST file encryption uses a
different password derivation.


Hello experts, can you please explain my concerns?



.



Relevant Pages

  • Encrypting changes file dates
    ... When I encrypt or decrypt a folder all the files get there dates changed to ... This is really a pain when looking through the history of a project and ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Back Doors
    ... >> Design into the system a master key. ... Encrypt that with public key. ... Decrypt random symmetric key with private key. ...
    (sci.crypt)
  • Re: Need help with Windows XP EFS
    ... Because I searched some and on>the Microsoft>>website it says that if you don't have a recovery agent>certificate it's not>>possible to recover anything. ... >>>>I just need a small hint on how to get windows to accept>the master key so>>it can decrypt the private key. ... I assume that letting>Microsoft recover my>>private key will cost me a lot of money too. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: How come EFS has locked me out of my files?
    ... I have a folder with some very important files which are encrypted using ... account it sounds as though you changed it from the/an admin account. ... By doing the change from admin to a standard user through an admin account ... you made the master key inaccessible for that account. ...
    (microsoft.public.windows.vista.general)
  • Re: How come EFS has locked me out of my files?
    ... > via the advanced properties dialog on the folder. ... account it sounds as though you changed it from the/an admin account. ... By doing the change from admin to a standard user through an admin account ... you made the master key inaccessible for that account. ...
    (microsoft.public.windows.vista.general)

Quantcast