Difference between revisions of "NTLM (NT LAN Manager)"

From Bauman National Library
This page was last modified on 18 June 2016, at 15:03.
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
 
| website                = [https://msdn.microsoft.com/en-us/library/windows/desktop/aa378749(v=vs.85).aspx  Official]
 
| website                = [https://msdn.microsoft.com/en-us/library/windows/desktop/aa378749(v=vs.85).aspx  Official]
 
}}
 
}}
'''NTLM(NT LAN Manager)''' is a family of authentication protocols.
 
  
__TOC__
+
'''NT LAN Manager (NTLM)''' is a suite of Microsoft security protocols that provides authentication, integrity, and confidentiality to users. The NTLM authentication protocols include LAN Manager version 1 and 2, and NTLM version 1 and 2. The NTLM authentication protocols authenticate users and computers based on a challenge/response mechanism that proves to a server or domain controller that a user knows the password associated with an account. When the NTLM protocol is used, a resource server must take one of the following actions to verify the identity of a computer or user whenever a new access token is needed:
 
+
NT LAN Manager (NTLM) is a suite of Microsoft security protocols that provides authentication, integrity, and confidentiality to users. The NTLM authentication protocols include LAN Manager version 1 and 2, and NTLM version 1 and 2. The NTLM authentication protocols authenticate users and computers based on a challenge/response mechanism that proves to a server or domain controller that a user knows the password associated with an account. When the NTLM protocol is used, a resource server must take one of the following actions to verify the identity of a computer or user whenever a new access token is needed:
+
 
#Contact a domain authentication service on the domain controller for the computer's or user's account domain, if the account is a domain account.
 
#Contact a domain authentication service on the domain controller for the computer's or user's account domain, if the account is a domain account.
 
#Look up the computer's or user's account in the local account database, if the account is a local account.
 
#Look up the computer's or user's account in the local account database, if the account is a local account.
Line 63: Line 60:
 
And it becomes evident that safe today can be considered a value greater than 3 (Send NTLMv2 response only).
 
And it becomes evident that safe today can be considered a value greater than 3 (Send NTLMv2 response only).
  
==References ==
+
== References ==
 +
{{reflist}}
 +
 
 +
== Notes ==
 
* [https://msdn.microsoft.com/library/aa378749(vs.85).aspx NTLM]
 
* [https://msdn.microsoft.com/library/aa378749(vs.85).aspx NTLM]
 
* [https://technet.microsoft.com/en-us/library/hh831571(v=ws.11).aspx NTLM Overview]
 
* [https://technet.microsoft.com/en-us/library/hh831571(v=ws.11).aspx NTLM Overview]
 
* [https://en.wikipedia.org/wiki/NT_LAN_Manager Wiki-NTLM]
 
* [https://en.wikipedia.org/wiki/NT_LAN_Manager Wiki-NTLM]
 
== Notes ==
 

Latest revision as of 15:03, 18 June 2016

NT LAN Manager
Developer(s) Microsoft Windows Corporation
Repository {{#property:P1324}}
Written in C++
Operating system MS-DOS, Windows Server
Type NT LAN Manager
Website Official

NT LAN Manager (NTLM) is a suite of Microsoft security protocols that provides authentication, integrity, and confidentiality to users. The NTLM authentication protocols include LAN Manager version 1 and 2, and NTLM version 1 and 2. The NTLM authentication protocols authenticate users and computers based on a challenge/response mechanism that proves to a server or domain controller that a user knows the password associated with an account. When the NTLM protocol is used, a resource server must take one of the following actions to verify the identity of a computer or user whenever a new access token is needed:

  1. Contact a domain authentication service on the domain controller for the computer's or user's account domain, if the account is a domain account.
  2. Look up the computer's or user's account in the local account database, if the account is a local account.

The operating principle of NTLM

The operating principle of NTLM has much in common with the LAN Manager [1], and these protocols are backwards compatible, but there are significant differences. NT-hash is generated based on the password up to 128 characters on the MD4 algorithm, the password is case-sensitive and can contain not only ACSII characters but the Unicode, which greatly increases its resistance as compared to the LM. The work takes place in the following way (Fig.1):

NTLM 1.png
Fig.1 The operating principle of NTLM

To gain access to the resources of the client directs the request to the server with a user name. The server sends back to it the random number, called a server request. The client encrypts the request by DES algorithm, using as NT-hash key password, use 40 or 56 bit key (hash is divided into three parts and each part of the server encrypts the request separately), as the NT-hash is 128 bit long.

The encrypted hash of the password server query response called NTLM, and returns back to the server, the server takes from the SAM hash of the user's password, whose name has been transferred to him and perform the same actions with the server query, and then compares the result with the response from the NTLM. In case of coincidence of values, the authentication is successful, and it means the client user is really who he claims to be.

In the third resource access receiving circuit is changed (Fig.2):

NTLM 2.png
Fig.2 Principle of operation NTLM when accessing third resource

Upon receiving a request from a client, the server sends him to the server request, but received NTLM-answer, he is not able to calculate the value to be tested at his side, as it does not have the password hash of a domain user, and then he forwards the NTLM-response domain controller and sends it your server request. After receiving this information, the domain controller removes the specified user hash and calculates the check sequence of server-based query which have received and compares with NTLM-response. If they are equal, the message is sent to the server that the authentication is successfully passed.

Although at that, NTLM protocol is today considered weak. Weak encryption makes it possible to quickly restore the password hash, and if used, not only the NTLM, and also the LM-reply, and to recover the password.

NTLMv2

Therefore, it is the second version that takes into account the error of the weak encryption and cryptographic low. There is already a customer, referring to the server tells it a user name and domain name, and the server sends back to it the random number, called the "query server". In response the client generates a random number and where the time stamp is added, which is called the "customer request". Have time stamp to avoid a situation where an attacker initially stores the captured data, and then using them carries out the attack.

Query server combined with the customer's request and from this sequence is computed HMAC-MD5 hash. Then, from this hash is taken one HMAC-MD5 hash key which acts NT-hash of the user's password. The obtained result is called NTLMv2-response and, together with the client's request is sent to the server.

The server, receiving NTLMv2-response and client's request, connects the data and also calculates a hash HMAC-MD5, and then sends it along with the response to the domain controller. He takes from the storage stored hash of the user's password and performs calculations on the HMAC-MD5 hash of server requests and the client by comparing the result obtained with the transferred him NTLMv2-response. In the case that the server returns a response about the successful authentication.

Use of protocol versions

NTLMv2 protocol is quite safe, but if the system is configured correctly, the attacker can send NTLM or LM request and receive an appropriate response, which will successfully carry out the attack. Therefore, we consider the safety policy and for the choice of the authentication protocol meets local or group policy.

Value Setting Client's computer Domain controller
0
Send LM & NTLM responses Clients use LM and NTLM authentication, and never use NTLMv2 session security. [2] DCs[3]accept LM, NTLM, and NTLMv2 authentication.
1
Send LM & NTLM - use NTLMv2 session security if negotiated Clients use LM and NTLM authentication, and use NTLMv2 session security if server supports it DCs accept LM, NTLM, and NTLMv2 authentication.
2
Send NTLM response only Clients use NTLM authentication only, and use NTLMv2 session security if server supports it DCs accept LM, NTLM, and NTLMv2 authentication.
3
Send NTLMv2 response only Clients use NTLMv2 authentication only, and use NTLMv2 session security if server supports it. DCs accept LM, NTLM, and NTLMv2 authentication.
4
Send NTLMv2 response only\refuse LM Clients use NTLMv2 authentication only, and use NTLMv2 session security if server supports it. DCs refuse LM (accept only NTLM and NTLMv2 authentication).
5
Send NTLMv2 response only\refuse LM & NTLM Clients use NTLMv2 authentication only, and use NTLMv2 session security if server supports it. DCs refuse LM and NTLM (accept only NTLMv2 authentication).

And it becomes evident that safe today can be considered a value greater than 3 (Send NTLMv2 response only).

References

Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />

Notes

  1. http://en.bmstu.wiki/LAN_Manager All about LAN Manager
  2. When the client will pass the authentication session key is generated, which is used to confirm the authenticity of the further cooperation. NTLM session key is based only on NT-hash and will be the same as long as the customer does not change the user's password. What are the security risks this carries to explain, it seems, do not. NTLMv2 session security means the session key calculation using not only the NT-hash, but the server and the client's requests, which makes the key unique and much more resistant to possible attacks.
  3. DCs - are domain controllers