NTLM驗證過程

來源:互聯網
上載者:User
文章目錄
  • 參考文獻:
  • 本文
參考文獻:

Microsoft NTLM

Kerberos串連過程

本文

NTLM有Interactive和Noninteractive兩種,Interactive就是使用者登入類型的,只有client和DC兩個參與者,而Noninteractive則是Client要去串連一個Server。在Microsoft NTLM給出了NTLM的Noninteractive驗證過程,有如下7步過程:

  1. (Interactive authentication only) A user accesses a client computer and provides a domain name, user name, and password. The client computes a cryptographic hash of the password and discards the actual password.
  2. The client sends the user name to the server (in plaintext).
  3. The server generates a 16-byte random number, called a challenge or nonce, and sends it to the client.
  4. The client encrypts this challenge with the hash of the user's password and returns the result to the server. This is called the response.
  5. The server sends the following three items to the domain controller:

    • User name
    • Challenge sent to the client
    • Response received from the client
  6. The domain controller uses the user name to retrieve the hash of the user's password from the Security Account Manager database. It uses this password hash to encrypt the challenge.
  7. The domain controller compares the encrypted challenge it computed (in step 6) to the response computed by the client (in step 4). If they are identical, authentication is successful.

但是其中有些地方不夠詳細,我在本文中加以補充。NTLM是windows驗證的一種,其過程如所示:

下面來詳細解析NTLM驗證過程,仍然是七步過程:

  1. 使用者登入時輸入的user name、password和domain name,然後Client端計算password的hash值並儲存在本地
  2. 用戶端將user name的明文發送給DC
  3. DC產生一個16-byte的隨機數,叫做challenge,傳輸給client
  4. client收到challenge以後,在複製一份拷貝,然後將其中一個challenge用password hash加密,這個叫做response,然後將challenge,response以及user name傳送給server
  5. server端在收到client傳送過來的三份內容以後將它們轉寄給DC
  6. DC在收到user name,response,challenge以後,根據user name在account database中找到其對應的password hash,然後用這個password hash加密challenge
  7. 最後一步是用戶端將response跟加密後的challenge進行比較,如果相同則NTLM驗證成功。

在Microsoft NTLM的最後還提到了另外一點,就是讓我們不要直接使用NTLM,而是使用negotiate。如果使用negotiate的話,那麼windows會判斷kerberos是否可用,如果可用就優先使用kerberos,否則使用NTLM。kerberos的安全性要比NTLM要高。

在sharepoint的中就有NTLM和negotiate的選擇,預設選擇的是NTLM,如果知道如何配置kerberos的話,建議使用negotiate模式。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.