History and Evolution of Microsoft LAN Manager (LANMAN) and NTLM Authentication Protocols - ToddMaxey/Technical-Documentation GitHub Wiki
History and Evolution of Microsoft LAN Manager (LANMAN) and NTLM Authentication Protocols
Historical Context and Origins of LAN Manager Authentication
Microsoft's LAN Manager (LANMAN) was a network operating system and suite of networking protocols co-developed with IBM in the late 1980s (LAN Manager - Wikipedia) (LAN Manager - Wikipedia). As part of this system, Microsoft introduced the LAN Manager authentication protocol to control access to shared network resources. This protocol was designed for early enterprise networking environments (e.g. OS/2 and MS-DOS networks) and became the foundation for authentication in Microsoft networks prior to Windows NT (LAN Manager - Wikipedia). LANMAN authentication was integrated into products like IBM/Microsoft OS/2 LAN Server and early Windows for Workgroups, providing a way for clients to prove their identity to file servers using a challenge-response mechanism. By the early 1990s, LANMAN’s authentication method was widely adopted in Windows networking stacks, including in Windows 3.x/9x clients when connecting to file shares on LAN Manager or Windows NT servers. However, as security requirements grew, this legacy protocol's weaknesses prompted the development of more secure successors.
LANMAN Authentication Mechanisms and Vulnerabilities
LANMAN authentication employs a challenge–response protocol underpinned by a fixed-length hash of the user's password known as the LM hash. When a client attempts to authenticate, the server sends an 8-byte random challenge. The client computes a response using its secret LM hash and returns it; the server verifies this to authenticate the user. The LM hash itself is generated by a peculiar algorithm dating to the 1980s, reflecting the limited security expectations of that era (LAN Manager - Wikipedia):
-
LM Hash Algorithm: Passwords are limited to 14 characters, converted to uppercase (making them case-insensitive), and encoded in an OEM codepage (LAN Manager - Wikipedia). The password is null-padded to 14 bytes and split into two 7-byte halves (LAN Manager - Wikipedia). Each half is used as a key to DES (Data Encryption Standard), and each encrypts the same constant ASCII string
"KGS!@#$%"
in Electronic Codebook mode (LAN Manager - Wikipedia). The two 8-byte DES ciphertexts are concatenated to produce the 16-byte LM hash value (LAN Manager - Wikipedia). This LM hash (also stored on the server) effectively becomes the secret for authentication. -
Challenge-Response Operation: Upon receiving the server's 8-byte challenge, the client derives three 56-bit DES keys from the 16-byte LM hash (padding the hash with five zero bytes to make 21 bytes, then splitting into three 7-byte keys) (NTLM - Wikipedia) (NTLM - Wikipedia). Each key encrypts the challenge using DES, yielding three 8-byte blocks that are concatenated into a 24-byte LM response (NTLM - Wikipedia). The server (or domain controller) performs the same computation with the user's stored LM hash and compares the 24-byte result to validate the client’s response (NTLM - Wikipedia) (NTLM - Wikipedia). This protocol does not transmit the password itself, only the challenge and encrypted hash response, which was an improvement over plaintext passwords on the network.
Despite using DES (a then-standard symmetric cipher), the LANMAN scheme has severe cryptographic weaknesses that became apparent as computing power increased (LAN Manager - Wikipedia) (LAN Manager - Wikipedia):
-
Limited Key Space: Password length is capped at 14 characters, and all letters are forced to uppercase, drastically reducing the effective key space (LAN Manager - Wikipedia) (LAN Manager - Wikipedia). (For example, "Password", "PASSword", and "password" all yield the same LM hash (LAN Manager - Wikipedia).) This case insensitivity shrinks the alphabet and aids attackers.
-
Independent Halves: Treating the password as two independent 7-character halves means an attacker can crack each half separately. Instead of a single 14-character search space, the attacker faces two much smaller searches, each of 7 characters (LAN Manager - Wikipedia). This makes brute-force or dictionary attacks dramatically faster – the effective strength of a 14-character LM password is roughly equivalent to two 7-character passwords (on the order of 2^44 possibilities, rather than 2^86) (LAN Manager - Wikipedia). In fact, a modern GPU can test on the order of 40 billion LM-hash candidates per second, meaning all 7-character alphanumeric combinations can be cracked in mere seconds to minutes (LAN Manager - Wikipedia).
-
Fixed Output, No Salting: If a password is ≤7 characters, the second half of the LM hash is a constant
0xAAD3B435B51404EE
(the DES encryption of"KGS!@#$%"
with a null key), visibly indicating a short password (LAN Manager - Wikipedia). More generally, LM hashes are unsalted and static – identical passwords always produce the same hash. The hash is thus a password-equivalent secret: anyone who obtains the hash can reuse it to authenticate (a classic "pass-the-hash" scenario) or crack it offline (NTLM - Wikipedia). Attackers can precompute vast rainbow tables of LM hashes, enabling virtually instant cracking of common passwords (LAN Manager - Wikipedia) (LAN Manager - Wikipedia). In practice, tools like Ophcrack and Hashcat easily invert LM hashes using precomputed tables (LAN Manager - Wikipedia). -
Lack of Integrity or Server Authentication: The LANMAN scheme provides no cryptographic integrity protection or way for the server to prove its identity to the client. It is purely one-way authentication (client to server). This opens the door to man-in-the-middle and replay attacks. For instance, an attacker who can intercept and replay the 24-byte response to the server's challenge could potentially impersonate the client (though the use of a fresh random challenge each time mitigates simple replays). More dangerously, a malicious server could present a known challenge and use the captured response to crack the client's password offline (NTLM - Wikipedia). The absence of mutual authentication and session key establishment means LANMAN offers no safeguards against session hijacking or credential forwarding.
These vulnerabilities made LANMAN authentication increasingly untenable as attacks improved. By the early 1990s, cracking LANMAN hashes became trivial without strong passwords (LAN Manager - Wikipedia). Recognizing these weaknesses, Microsoft began phasing out LANMAN in favor of new protocols, though legacy support persisted for years due to backward compatibility needs.
Emergence of NTLM in Windows NT (NTLMv1)
With the development of Windows NT, Microsoft introduced NTLM (NT LAN Manager) as the successor to LANMAN authentication (NTLM - Wikipedia) (LAN Manager - Wikipedia). First implemented in Windows NT 3.1 (1993), the original NTLM protocol – later called NTLMv1 – aimed to strengthen password security while retaining the same basic challenge-response model (LAN Manager - Wikipedia). NTLMv1 brought several important changes in hashing algorithms and encoding:
-
Unicode and MD4-Based Hashing: NTLM abandoned the old LM hash algorithm in favor of the NT hash, which is the 16-byte MD4 digest of the user's password in UTF-16 little-endian encoding (LAN Manager - Wikipedia). This MD4-based one-way function (sometimes called NTOWF) accepts the full Unicode password (up to 127 characters) without the artificial 14-character limit or uppercasing (LAN Manager - Wikipedia). Thus, NTLM hashes preserve case sensitivity and can represent much stronger passwords than LM's scheme. The NT hash is still unsalted, but its larger keyspace and removal of the split-halves weakness marked a significant improvement (LAN Manager - Wikipedia). (For backward compatibility, Windows NT systems continued to store the older LM hash alongside the NT hash, but the NT hash would be used for the newer protocol (LAN Manager - Wikipedia).)
-
Protocol Workflow: NTLMv1 maintained the same three-step challenge-response handshake as LANMAN. The server sends an 8-byte challenge, and the client responds with a 24-byte value proving knowledge of the secret. In fact, NTLMv1 in practice often computes two responses: one using the LM hash and one using the NT hash, and both 24-byte responses are sent to the server (NTLM - Wikipedia) (NTLM - Wikipedia). This allowed interoperability during the transition – older servers could still accept the LM-based response, whereas newer servers would prefer the NT-based response. The NTLMv1 response using the NT hash is computed similarly to LANMAN: the 16-byte NT hash is zero-padded to 21 bytes, split into three 7-byte DES keys, and used to encrypt the challenge, yielding a 24-byte NTLM response (NTLM - Wikipedia). In effect, NTLMv1 uses a different underlying hash (MD4 instead of the DES-based LM hash) but continues to rely on DES encryption of the challenge with 56-bit keys.
-
Security Features: Windows NT introduced the concept of a Security Support Provider (SSP) for authentication, and NTLM was implemented as an SSP that could negotiate optional features like session security. NTLMv1 could derive a session key from the user's NT hash and use it to provide message integrity or confidentiality on the session (for example, to sign SMB messages) (NTLM - Wikipedia). However, the cryptographic algorithms for these features were still weak by modern standards (e.g. NTLM uses 56-bit DES and RC4 for encryption and non-cryptographic CRC32 or MD5 for integrity in various modes) (NTLM - Wikipedia). Moreover, NTLMv1 still did not fundamentally change the one-way nature of authentication; it did not provide true server authentication or protection against relay attacks.
While NTLMv1's use of a stronger hash function (MD4) eliminated the egregious flaws of the LM hash, cryptographic weaknesses remained:
-
The NT hash, like the LM hash, is unsalted and thus susceptible to offline cracking if obtained. An attacker in possession of the NT hash can brute-force it or use it directly in a pass-the-hash attack to impersonate the user (NTLM - Wikipedia). MD4, while not saltable in this scheme, is a fast hashing algorithm without significant built-in work factor, making brute-force feasible given modern hardware (and MD4 has known cryptographic weaknesses, though preimage attacks are not trivial).
-
NTLMv1 continued to use 56-bit DES for the challenge encryption stage (LAN Manager - Wikipedia). By the 1990s, 56-bit keys were becoming weak against brute force. Additionally, researchers demonstrated that if an attacker could control the challenge (e.g. a malicious server issuing a known 8-byte challenge), they could precompute a dictionary of challenge->response mappings for common passwords, enabling efficient lookup attacks (NTLM - Wikipedia). In essence, NTLMv1 was vulnerable to chosen-challenge attacks by rogue servers, which could negate the benefit of the challenge-response scheme.
-
Critically, NTLMv1 still did not provide mutual authentication. A client had no cryptographic proof that the server was legitimate. This opened the protocol to NTLM relay attacks, where an attacker tricking a client to authenticate could relay that authentication to a real server and gain access, since the client’s NTLM response can be forwarded (if the attacker keeps the challenge consistent) to another server. Without a mechanism like a server signature or a trusted third-party, NTLMv1 could be abused in man-in-the-middle scenarios.
-
For many years, Windows systems were configured to send both LM and NTLMv1 responses by default, for compatibility with legacy clients and servers (LAN Manager - Wikipedia). This meant that the presence of the weaker LM hash undermined NTLMv1's improvements: an attacker sniffing the authentication traffic could focus on cracking the LM response (which was far easier), then derive the password and use it to compute the NTLM response. The full security benefit of NTLMv1 was only realized once LANMAN hashes/responses were disabled entirely.
Despite these issues, NTLMv1 was a step forward and became the backbone of Windows network logons throughout the 1990s for both local and domain authentication (except on Active Directory domains later, as described below). Microsoft documents from the Windows NT era often refer to “Windows NT Challenge/Response Authentication,” which corresponds to NTLMv1 (and the optional LM compatibility). By the late 1990s, however, the need for a stronger version was clear, leading to the next evolution: NTLMv2.
NTLMv2: Enhanced Challenge-Response Security
By the mid-1990s, mounting security concerns led Microsoft to develop NTLM version 2 (NTLMv2) as a more robust replacement for NTLMv1. NTLMv2 was officially introduced with Windows NT 4.0 Service Pack 4 (1998) and was natively supported in Windows 2000 and later systems (NTLM - Wikipedia). It retained the same overall authentication workflow (client-server challenge-response) but made important changes to the cryptographic scheme and added security features to mitigate prior vulnerabilities:
-
HMAC-MD5-Based Response: NTLMv2 moved away from the DES encryption of challenges. Instead, it uses an HMAC-MD5 algorithm to compute the response, with the user's NT hash serving as the key (NTLM - Wikipedia) (NTLM - Wikipedia). The client combines the 8-byte server challenge with its own client challenge and other metadata, and then computes an HMAC-MD5 digest. This digest is sent as the authentication response. In practice, NTLMv2 sends two related responses: one for compatibility with the 24-byte length of older protocols (often called the LMv2 response) and one variable-length response (the NTv2 response) that carries additional security data (NTLM - Wikipedia) (NTLM - Wikipedia). Both are derived using the NT hash and an HMAC-MD5 computation over the challenges and the user's identity:
-
The LMv2 response is essentially
HMAC-MD5(NT_hash, server_challenge || client_challenge)
, producing 16 bytes, which are sent along with the 8-byte client challenge to form a 24-byte package (NTLM - Wikipedia) (NTLM - Wikipedia). This fits the legacy 24-byte field and is used in place of the old LM response. -
The NTv2 response includes a richer client challenge structure: it incorporates a timestamp, the client (user) name and domain, and other fixed format data in addition to an 8-byte random client nonce (NTLM - Wikipedia) (NTLM - Wikipedia). The server’s challenge and this entire blob are HMAC-MD5 hashed with the NT hash (and username/domain) to produce a 16-byte NTv2 response (NTLM - Wikipedia). The blob is sent alongside the NTv2 hash. By including a timestamp and the target server info in the hash, NTLMv2 thwarts replay attacks (the response is bound to the current time and specific server) and prevents an attacker from precomputing responses without knowing the target context.
-
-
Stronger Key Derivation: NTLMv2 effectively uses the NT hash (MD4 of the password) only as a key, not directly as the value being DES-encrypted. It also mixes in the username and domain when deriving the key (an intermediate v2 hash = HMAC-MD5(NT_hash, username || domain)) (NTLM - Wikipedia). This means the attacker, even if controlling the challenge, can no longer use a simple dictionary of DES outputs to crack the hash. The inclusion of a client-side nonce and timestamp means each authentication produces a unique response, defeating the kind of precomputed rainbow table attacks that plagued LM and NTLMv1.
-
Security Improvements: NTLMv2 was explicitly designed to harden the protocol against spoofing and reflection attacks (NTLM - Wikipedia). Notably, NTLMv2 introduced an ability for the server to authenticate to the client, primarily by deriving a session key that both parties share after the handshake. Using this session key, NTLMv2 supports message integrity and encryption for subsequent communications (often referred to as "NTLM session security"). In essence, if the client negotiates signing or sealing of the session (as in SMB packet signing), the server must prove it knows the session key (which is derived from the user's NT hash and the handshake) by correctly signing messages. This offers a form of mutual authentication, ensuring the client that the server is genuine (NTLM - Wikipedia). Such features were absent in LANMAN and NTLMv1.
-
Protocol Resilience: By using modern cryptographic primitives of the time (HMAC-MD5) and incorporating nonces and timestamps, NTLMv2 greatly increased the computational effort for attackers. There was no feasible way to invert the NTLMv2 response without performing brute-force on the password itself, and the protocol was resistant to the "rogue server challenge" attack because the client contributes randomness to the challenge (NTLM - Wikipedia). However, NTLMv2 did not solve all problems: it still relies on the secrecy of the NT hash, which if stolen (from a server’s SAM database or elsewhere) is subject to offline cracking or pass-the-hash misuse. Furthermore, NTLMv2 remains a challenge-response scheme without a trusted third party, so it is still vulnerable to relay attacks (an attacker who can intercept the handshake and immediately relay it to a legitimate server can impersonate the client to that server). In summary, NTLMv2 vastly improved security but inherited the fundamental limitations of any two-party challenge-response protocol.
NTLMv2 quickly became the recommended authentication mechanism for Windows networks by the early 2000s. Microsoft provided upgrades for Windows 95/98 clients (the "Directory Services Client" for Windows 9x) to support NTLMv2 when communicating with Windows 2000 domains (LAN Manager - Wikipedia). By Windows 2000, all Microsoft systems were capable of using NTLMv2, and it was made the default for network authentication in situations where the newer Kerberos protocol was not applicable.
Deprecation of LANMAN/NTLM and the Shift to Kerberos
As Microsoft introduced stronger protocols, LANMAN (LM) authentication was gradually deprecated. Backward compatibility requirements meant that legacy support could not be dropped overnight; instead, it was controlled via system policies and eventually phased out:
- Coexistence and Phase-Out: For years, Windows servers and clients continued to support LM and NTLMv1 alongside NTLMv2 to accommodate older systems. A configuration setting known as "LAN Manager authentication level" allowed administrators to specify the minimum protocol to accept – ranging from allowing LM responses to requiring NTLMv2 only (Authentication protocols and avoiding downgrade attacks | Crowe LLP). By default, Windows NT/2000/XP would still accept LM and NTLMv1, and send them when needed, which left systems open to downgrade attacks. In a downgrade attack, a malicious intermediary can trick a client into using the weakest common protocol. For example, an attacker could induce a Windows machine to fall back to LM or NTLMv1, then capture the response and crack it easily (Authentication protocols and avoiding downgrade attacks | Crowe LLP) (Authentication protocols and avoiding downgrade attacks | Crowe LLP).
(Authentication protocols and avoiding downgrade attacks | Crowe LLP) An example of a downgrade attack: an attacker coerces a target system to negotiate the outdated NTLMv1 protocol, then intercepts the challenge and hashed response. Weak protocols like LM/NTLMv1 enable attackers to capture credentials for offline cracking or relay attacks.
-
Progressive Deactivation of LM Hashes: Microsoft eventually moved to disable the storage and use of LM hashes. Starting with Windows Vista (2007) and Windows Server 2008, the LM hash is no longer stored for local passwords by default (LAN Manager - Wikipedia). This means even if an attacker dumps the password database, they cannot obtain LM hashes (unless the policy is manually lowered or the password is old and under 15 characters) (LAN Manager - Wikipedia). Administrators were encouraged to set policies to refuse LM responses over the network as well, effectively retiring the LANMAN protocol except in legacy environments (LAN Manager - Wikipedia). Similarly, NTLMv1 is now considered obsolete and is often recommended to be turned off on modern Windows networks, as it provides little security benefit and is vulnerable to attack if used (LAN Manager - Wikipedia).
-
Adoption of Kerberos (Windows 2000+): A major turning point came with Windows 2000 and the introduction of Active Directory (AD). Microsoft adopted the Kerberos v5 protocol (originally developed at MIT) as the default authentication method for Active Directory domains (NTLM - Wikipedia). Kerberos is a fundamentally different scheme – a ticket-based authentication protocol relying on a trusted third-party (a Key Distribution Center) to issue tickets granting access. It offers strong cryptographic guarantees, including mutual authentication (both client and server verify each other) and the use of modern encryption algorithms. In Windows 2000 and later, whenever a user in a domain logs in or accesses a domain resource, Kerberos is used by preference, with NTLM only employed as a fallback (for example, if the service does not support Kerberos, or in certain cross-domain scenarios) (NTLM - Wikipedia) (NTLM - Wikipedia). The shift to Kerberos was driven by the need for better security and scalability: Kerberos can use strong ciphers (AES in newer versions), avoids sending crackable password-derived hashes over the network, and is not susceptible to replay or relay in the same way as NTLM. It also enables features like delegation and single sign-on across services in a domain.
-
Legacy and Compatibility: Even after Kerberos became the default, NTLM did not disappear. NTLM (specifically NTLMv2) remains in use for backward compatibility and in scenarios where Kerberos is not feasible (NTLM - Wikipedia) (NTLM - Wikipedia). For instance, workgroup environments (non-domain systems) or authentication to an IP address (where no SPN is available for Kerberos) still rely on NTLM. Additionally, older SMB implementations and devices might only support NTLM. To address this, Microsoft’s "Negotiate" SSP will automatically choose Kerberos or NTLM depending on what both client and server support (NTLM - Wikipedia). Over time, however, Microsoft has strongly discouraged relying on NTLM: as of 2010, they officially recommended against NTLM in new applications, citing its lack of support for modern cryptography (no AES, SHA-2, etc.) (NTLM - Wikipedia). In contemporary Windows networks, best practice is to disable LM and NTLMv1 entirely and require NTLMv2 or Kerberos, thereby eliminating the weakest links.
Conclusion
The LAN Manager authentication protocol and its successors (NTLMv1 and NTLMv2) illustrate the evolution of enterprise authentication in response to advancing threats. LANMAN provided a baseline of security appropriate for the late 1980s, but its DES-based design and limited password space quickly became inadequate (LAN Manager - Wikipedia) (LAN Manager - Wikipedia). NTLMv1, introduced with Windows NT, improved matters by using Unicode passwords and the MD4 hash, yet it retained structural weaknesses (unsalted hashes, no true server authentication) (LAN Manager - Wikipedia) (LAN Manager - Wikipedia). NTLMv2, released in the late 1990s, fortified the protocol with HMAC-MD5 and variable challenges, addressing many (though not all) of the vulnerabilities of its predecessors (NTLM - Wikipedia) (NTLM - Wikipedia). Each step in this evolution balanced stronger security with the need to support legacy systems, leading to a prolonged period of coexistence. Ultimately, Microsoft’s adoption of Kerberos in Active Directory marked a shift to an industry-standard, more secure authentication paradigm (NTLM - Wikipedia). Today, while NTLMv2 endures as a fallback, the LANMAN protocol survives only as a historical footnote – a reminder of how cryptographic design must continually progress to meet the challenges posed by faster computers and smarter attackers.
Sources:
- Microsoft LAN Manager and NTLM protocol specifications and documentation (NTLM - Wikipedia) (NTLM - Wikipedia) (LAN Manager - Wikipedia)
- Academic and industry analyses of LM/NTLM cryptographic weaknesses (LAN Manager - Wikipedia) (LAN Manager - Wikipedia)
- Windows security guidelines on authentication protocols and their deprecation (LAN Manager - Wikipedia)