On this page 21 sections
- Windows authentication overview
- Password, hash and challenge-response
- LM hashes
- NT hashes
- NTLM authentication
- NTLM authentication flow
- NT hash vs NetNTLM
- NetNTLMv1 and NetNTLMv2
- Local accounts
- Domain accounts
- SAM database
- Why SYSTEM matters
- NTDS.dit
- SAM vs NTDS.dit
- LSASS and credential material
- Cached domain credentials
- Recognising common Windows hash types
- Offline password testing
- Credential reuse
- Relationship with Pass-the-Hash
- Quick reference
Windows authentication overview
Windows authentication can involve several types of credential material depending on whether the account is local, domain-based or authenticated across the network. The most important concepts to distinguish are passwords, NT hashes, NTLM challenge-response values and cached domain credentials.
Password, hash and challenge-response
A password is the original secret chosen by the user. A hash is a one-way value derived from that password. A challenge-response value is generated dynamically during authentication and is not the same thing as the stored password hash.
LM hashes
LM is a legacy Windows password hashing mechanism. It is considered weak because it converts passwords to uppercase, splits them into independent blocks and provides very limited resistance against cracking. Modern Windows systems normally have LM hashing disabled.
NT hashes
Modern Windows password authentication is based primarily on the NT hash. The NT hash is generated from the user password and is normally represented as 32 hexadecimal characters. It is often informally called an NTLM hash, although NTLM is technically the authentication protocol rather than the hash itself.
username:RID:LM_HASH:NT_HASHaad3b435b51404eeaad3b435b51404eeNTLM authentication
NTLM is a Windows challenge-response authentication protocol. The password itself is not normally transmitted across the network. Instead, the server sends a challenge and the client calculates a response using credential material derived from the user password.
NTLM authentication flow
The client requests authentication, the server returns a challenge, the client generates a response and the server verifies that response locally or through a Domain Controller. The important point is that the network exchange contains a challenge-response value rather than the plaintext password.
NT hash vs NetNTLM
An NT hash and a NetNTLM response are not interchangeable. The NT hash is derived directly from the password and represents reusable credential material in some Windows authentication scenarios. NetNTLMv1 and NetNTLMv2 are challenge-response values generated during network authentication.
NetNTLMv1 and NetNTLMv2
NetNTLMv1 is the older and weaker challenge-response mechanism. NetNTLMv2 provides stronger protection and is the version normally encountered on modern Windows systems. A captured NetNTLMv2 value may be tested offline against candidate passwords, but it cannot simply be treated as an NT hash.
Local accounts
Local accounts belong to a specific Windows machine and are authenticated using credential information stored locally. They can be referenced using the computer name or a dot prefix.
.\administratorWORKSTATION01\administratornet userDomain accounts
Domain accounts are managed centrally through Active Directory. Their authentication information is stored on Domain Controllers and the same account can normally be used across multiple domain-joined systems depending on its permissions.
CORP\samirsamir@corp.localecho %USERDOMAIN%SAM database
The Security Account Manager stores authentication information for local Windows accounts. The SAM database is protected by the operating system and is not normally readable directly while Windows is running.
C:\Windows\System32\config\SAMC:\Windows\System32\config\SYSTEMWhy SYSTEM matters
The SYSTEM registry hive contains key material used by Windows to protect secrets stored in the SAM database. For this reason, SAM and SYSTEM are commonly referenced together when studying local Windows credential extraction.
NTDS.dit
On a Domain Controller, Active Directory credential information is stored in the NTDS database rather than the local SAM. NTDS.dit contains directory objects and password-related data for domain accounts.
C:\Windows\NTDS\NTDS.ditSAM vs NTDS.dit
SAM is associated with local Windows accounts on an individual system. NTDS.dit is associated with Active Directory and domain accounts on a Domain Controller. This distinction is fundamental when analysing Windows credentials.
LSASS and credential material
LSASS is the Windows process responsible for enforcing local security policy and handling authentication. Depending on the authentication method and session state, credential-related material may be present in LSASS memory.
tasklist | findstr lsassCached domain credentials
Windows can cache domain logon information so that users can still sign in when a Domain Controller is unavailable. Modern systems commonly use Domain Cached Credentials version 2, also known as DCC2 or MSCache v2. These values are different from NT hashes.
Recognising common Windows hash types
Correctly identifying the credential format is important before analysing or testing it. NT hashes, NetNTLMv2 responses and cached domain credentials all use different formats and require different handling.
Hashcat mode 1000Hashcat mode 5600Hashcat mode 2100Offline password testing
When a password-derived value is available during an authorised assessment, it can be tested offline against candidate passwords. Offline testing does not repeatedly contact the target authentication service, so it behaves differently from online login attempts.
hashcat -m 1000 hashes.txt wordlist.txthashcat -m 5600 netntlmv2.txt wordlist.txtjohn --format=NT --wordlist=wordlist.txt hashes.txtCredential reuse
Reusing the same password across several systems increases the impact of a compromised account. This becomes particularly dangerous when the same local administrator password is used on multiple Windows hosts.
Relationship with Pass-the-Hash
In some Windows authentication scenarios, recovering the plaintext password is not required because the NT hash itself can be used as authentication material. This behaviour is the basis of Pass-the-Hash, which is covered separately as a credential reuse and lateral movement technique.
Quick reference
LM is a legacy password hash. NT is the modern Windows password hash. NTLM is the authentication protocol. NetNTLM is a network challenge-response value. SAM stores local account information. NTDS.dit stores Active Directory information. LSASS handles authentication in memory. DCC2 represents cached domain logon information.