DS-Account lockout 問題處理概觀:

1. 在相關的網域控制站上設定欲蒐集的資訊

2. 透過事件監控程式提醒管理員問題已發生

3. 蒐集相關的資訊至一個集中的資料夾以方便分析

4. 在事件檢視器裡,可以看到事件被記錄的事件 ID 及 Logon Type 和 Logon Process。

5. 您可以對照事件 ID 及 Logon Type 和 Logon Process 做為參考依據。

6. 在 Netlogon.log (在所有網域控制站上的 %windir%\debug\netlogon.log  目錄)裡,可以看到使用者帳號登入的資訊。

===============================================================

(1). 在相關的網域控制站上設定欲蒐集的資訊

  a. 將網域控制站上的群組原則上的帳號鎖定原則 LockoutBadCount 值設定在 7 以上. (Some known issue may occurs on Outlook/Exchange with 6 bad attemps.)  
  b. Windows 2000/2003 根據預設值,會安裝包含追蹤功能的 Netlogon.dll 版本。
如果要啟用偵錯記錄功能,請使用下列步驟在登錄中設定想要的偵錯旗標,然後重新啟動服務:

  1. 啟動 Regedt32 程式。
  2. 刪除下面登錄項目的 Reg_SZ 值,以相同的名稱建立 REG_DWORD 值,然後新增 0x2080FFFF 十六進位值。

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon Parameters\DBFlag

  1. 在命令提示字元下輸入 net stop netlogon,然後再輸入 net start netlogon。這樣就能啟用偵錯記錄功能。
  2. 如果要停用偵錯記錄功能,請在下面登錄機碼中將資料值改成 0x0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon Parameters\DBFlag

  1. 結束 Regedt32。
  2. 停止 Netlogon,然後再重新啟動 Netlogon。
  3. 此外,您現在不需使用登錄也可以設定 dbflag。
    如果要使用這種方法,請從命令提示字元執行下面命令:

nltest /dbflag:0x2000ffff

  1. 完成偵錯之後,您可以從命令提示字元執行下面命令,將 dbflag 重設為 0:

nltest /dbflag:0x0

  c. 啟用稽核原則。在網域控制站上的稽核原則上,更改下列設定值:

        1. 在系統管理工具,開啟網域安全性原則:

展開安全性設定,本機原則,稽核原則。分別開啟:
稽核帳戶登入事件:  失敗
稽核登入事件: 失敗 . 

稽核帳號管理: 成功

        2. 執行 secedit /refreshpolicy machine_policy /enforce (Windows 2003 使用gpupdate /force)以更新所有網域控制站上的原則設定。

這樣就可以開始將 netlogon 的相關活動記錄到所有網域控制站上的 %windir%\debug\netlogon.log  目錄上。

===============================================================

(2). 透過事件監控程式提醒管理員問題已發生
可以使用 Event Monitor 來監視 Account Lockout 的狀態
執行 eventmon  來監視當被鎖定的使用者帳戶有事件 event 644 出現。
===============================================================
(3). 蒐集相關的資訊至一個集中的資料夾以方便分析
當帳號被鎖定時,蒐集下列資訊:

1. 被鎖定的帳號名稱。

2. 該使用者帳號登入的電腦名稱。

3. 該使用者帳號被鎖定的實際時間。

4. 該電腦的作業系統版本(可以在開始, 執行上, 輸入 winver)及類別(是 Windows XP/NT/200?)

5. 使用者當時曾嘗試了幾次的密碼錯誤嘗試?

6. 在所有的 Domain controllers 上拿到所有的 Security log 及 netlogon.log 檔案。您可以依下列步驟使用 EventCombMT.exe 工具:

    To use the EventCombMT.exe tool, open the folder you specified during setup for ALTools, double-click EventCombMT.exe
    click the Searches menu, click Built in searches, and then click Account lockouts. When you do this, the events that will 
    be pulled from the event logs are automatically displayed in the tool. These events are from all of the domain controllers in
    your environment. In addition to 529, 644, 675, and 681, type 12294 in the Event Ids box, and then click Search. The tool
    then searches the computers for these events, and then saves them to a .txt file that you specify.

7. 在 PDC emulator 的 Domain Controller 上拿到 netlogon.log  ( 以及 netlogon.bak  ) 檔案。

8. 在一台 Domain Controller 執行 Account Lockout.exe (在 ALTOOLS.exe) 並抓取使用者登入及錯誤嘗試的資訊, 存成抓取畫面給我們。
9. 使用者當時做了些什麼嘗試? 是否變更改了密碼? 是否曾經試過改完後登出/登入一次?

(4) 在事件檢視器裡,可以看到事件被記錄的事件 ID Logon Type Logon Process 。以下提供一個範例:

    Date:     10/16/2002  Event ID:  528
    Time:     10:32:11 AM  Source:  Security
    User:     JoeSmith  Type:  Success Audit
    Computer: MKTINGDOM  Category: Logon/Logoff
  
    Description:
    Logon/Logoff: Successful
    Logon User Name: JoeSmith
    Domain: MKTINGDOM
    Logon ID: (0x0, 0x2D0D0)
    Logon Type: 3
    Logon Process: User32 Authentication Pkg:
       MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
    Workstation Name: \\WKS2

(5) 您可以對照下列的事件 ID Logon Type Logon Process ,做為參考依據。

 EventID   Description
 -------   -----------
    514     An authentication package has been loaded by the LSA
    515     A trusted logon process has registered with the LSA
    518     A notification package has been loaded by the Security
            Account Manager
    528     Successful Logon
    529     Logon Failure: Unknown user name or bad password
    530     Logon Failure: Account logon time restriction violation
    531     Logon Failure: Account currently disabled
    532     Logon Failure: The specified user account has expired
    533     Logon Failure: User not allowed to logon at this computer
    534     Logon Failure: The user has not been granted the requested
            logon type at this machine
    535     Logon Failure: The specified account's password has expired
    536     Logon Failure: The NetLogon component is not active
    537     Logon Failure: An unexpected error occurred during logon
    538     User Logoff
    539     Logon Failure: Account locked out
    644     User Account Locked Out            

   676     logon attempt with locked account: (Kerberos) Failure code 12

    681     logon attempt with locked account: (NTLM) Error code 3221226036 (C0000234) for locked account Exposes Frequency Pattern

    681 & 675 (badpassword) from all DCs Error code: 3221225578 (C000006A) badpassword: Gets NTLM and Kerberos badpasswords
Logon Type

"Logon Type" will be one of the following:

    2  Interactive (本機登入)
    3  Network
    4  Batch
    5  Service
    6  Proxy
    7  Unlock Workstation
    (0 & 1 are invalid)                                 
Logon Process

"msv1_0" or "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0":
     msv1_0.dll, the default authentication package

(6) Netlogon.log ( 在所有網域控制站上的 %windir%\debug\netlogon.log 目錄 ) 裡,可以看到使用者登入的狀況。因此在您的 DC , 可以看到帳號登入的資訊。以下提供一些範例:

Windows NT Workstation/2000 Professional/Server:

 [LOGON] SamLogon: Interactive logon of PORSCHE\example from 928S4 (via
    TARGA) Entered
  
 [LOGON] SamLogon: Interactive logon of PORSCHE\example from 928S4 (via
    TARGA) Returns 0xC000006A
  
 [LOGON] SamLogon: Interactive logon of PORSCHE\example from 928S4 (via
    TARGA) Entered
  
 [LOGON] SamLogon: Interactive logon of PORSCHE\example from 928S4 (via
    TARGA) Returns 0xC0000234                              

您可以看到該帳號在哪一台電腦嘗試登入,以及由回傳的代碼瞭解登入的狀態,請同時參考下表代碼意義:

0xC0000234 User logon with Account Locked

0xC000006A User logon with Misspelled or bad Password

0xC0000072 User logon to account disabled by Administrator

0xC0000193 User logon with Expired Account

0xC0000070 User logon from unauthorized workstation

0xC000006F User logon Outside authorized hours

0xC0000224 User logon with "Change Password at Next Logon" flagged

0xC0000071 User logon with Expired Password

0xC0000064 User logon with Misspelled or Bad User Account

通常我們需追蹤 234 6A 的錯誤以瞭解帳號鎖定問題。並同時參考事件檢視器裡有關安全性記錄檔在同時間點的記錄。

可以透過ALTOOLS.EXE的nlparse.exe來做分析確認來源端是否為特定機器

其他參考資訊:

Account Lockout and Management Tools https://www.microsoft.com/downloads/details.aspx?familyid=7AF2E69C-91F3-4E63-8629-B999ADDE0B9E&displaylang=en

啟用 Netlogon 服務的偵錯記錄功能

https://support.microsoft.com/?id=109626

HOW TO: Enable Kerberos Event Logging

https://support.microsoft.com/?id=262177

Using the Checked Netlogon.dll to Track Account Lockouts

https://support.microsoft.com/?id=189541

How To Determine from Which Computer a User Logged On

https://support.microsoft.com/?id=175062

Auditing User Authentication

https://support.microsoft.com/?id=174073

How to Identify User Who Changed Administrator Password

https://support.microsoft.com/?id=173939

Security Event Descriptions

https://support.microsoft.com/?id=174074