6

"Where are the two locations that user's password hashes are stored on a local windows machine?"

My place of business asked me this question. I know that the SAM stores password hashes, where would the other location be?

6
  1. C:\windows\system32\config\SAM (Registry: HKLM/SAM)
  2. System memory

The SAM file is mounted in the registry as HKLM/SAM. Windows locks this file, and will not release the lock unless it's shut down (restart, BSOD, etc). However, if you look at the SAM entry in the aforementioned registry section, you will not find the hash.

Therefore, it seems more than likely that the hash, or password, will also be stored in memory. In fact, there are quite a few password crackers that take your password directly from memory.

  • 2
    Thank you for the answer! I did a bit more digging and I learned that in memory, lsass holds on to a plaintext copy of the password for whoever is logged in. – Lutefisk Feb 10 '16 at 13:37
  • That's how a badUSB device can grab the hash. Rubber ducky, Malduino, P4wnP1 etc. – Andy Anderson Sep 19 '18 at 18:02
5

There is an additional location where they store cached domain credentials as MSCASH2 hashes:

HKEY_LOCAL_MACHINE\Security\Cache

So, if you are talking about a domain-joined machine, there are three places that you could find credentials stored.

  1. SAM file (need both C:\windows\system32\config\SAM, and C:\windows\system32\config\system)
  2. Registry (HKEY_LOCAL_MACHINE\Security\Cache for domain credentials, HKEY_LOCAL_MACHINE\SAM for local credentials)
  3. In-memory (dump with mimikatz) -- however this last one isn't "stored" as in written-to-disk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.