SAM & LSA secrets
MITRE ATT&CK™ Sub-techniques T1003.002, T1003.004 and T1003.005
Last updated
Was this helpful?
MITRE ATT&CK™ Sub-techniques T1003.002, T1003.004 and T1003.005
Last updated
Was this helpful?
In Windows environments, passwords are stored in a hashed format in registry hives like SAM (Security Account Manager) and SECURITY.
SAM
stores locally cached credentials (referred to as SAM secrets)
LM or NT hashes
SECURITY
stores domain cached credentials (referred to as LSA secrets)
Plaintext passwords
LM or NT hashes
Kerberos keys (DES, AES)
Domain Cached Credentials (DCC1 and DCC2)
Security Questions (L$
SQSA
<SID>
)
SYSTEM
contains enough info to decrypt SAM secrets and LSA secrets
N/A
The Security Account Manager (SAM) component is responsible for user management. It is present on all Windows computers, including domain controllers. It stores security objects like domains, users, groups/aliases
That's information are stored in registries, with the exception of domain controllers, which store the information in the file. SAM is accessible trought RPC.
SAM and LSA secrets can be dumped either locally or remotely from the mounted registry hives. These secrets can also be extracted offline from the exported hives. Once the secrets are extracted, they can be used for various attacks, depending on the credential format.
Plaintext passwords
LM and NT hashes
Kerberos keys (RC4, i.e. == NT hash)
Kerberos keys (DES, AES)
Domain Cached Credentials (DCC1 or DCC2)
Here are some examples and tools that can be used for local/remote/offline dumping.
, , or
, , , ,
, or
, or
's reg.py (Python) script can be used to remotely save hives from an UNIX-like machine. For instance, this can be used to easily escalate from a member to a Domain Admin by dumping a Domain Controller's secrets and use them for a .
's (Python) can be used to dump SAM and LSA secrets, either remotely, or from local files. For remote dumping, several authentication methods can be used like (LM/NTLM), or (Kerberos).
(Python) can be used to remotely dump SAM and LSA secrets, on multiple hosts. It offers several authentication methods like (NTLM), or (Kerberos)
This operation can be conducted remotely with (C++).
Alternatively, from a live Windows machine, the hive files can also be exfiltrated using like demonstrated for an NTDS export.
can be used locally to extract credentials from SAM
and SECURITY
registry hives (and SYSTEM
for the encryption keys), or offline with hive dumps.