Active Directory 密碼複雜度規則要求至少 6 個字元、4 個字元類型中至少包含 3 個(大寫、小寫、數字、符號),並且不能有明顯的重複或連續模式(例如 "111" 或 "abc")。這些規則在使用者變更或重設密碼時會立即強制執行,但您可以在將密碼提交到網域控制站之前先在本機檢查是否符合規範。密碼強度檢查工具讓您輸入一個候選密碼,並立即查看它是否符合 Active Directory 內建的條件,並提供符合 NIST 標準的長度、字元多樣性與可預測模式的回饋。由於此工具完全在您的瀏覽器中執行,不會上傳或記錄任何內容,因此您可以自由測試密碼,而不會觸發稽核事件或產生網路流量。
在典型的 Active Directory 環境中,預設的網域密碼原則是透過群組原則(gpedit.msc → 電腦設定 → Windows 設定 → 安全性設定 → 帳戶原則 → 密碼原則)來設定的。6 項複雜度要求如下:最小長度為 6,最大長度為 128,至少包含 1 個大寫字母,至少包含 1 個小寫字母,至少包含 1 個數字,至少包含 1 個符號(來自 !@#$%^&*()-+_= 集合),且連續相同的字元不得超過 2 個。此外,密碼不得包含使用者的帳戶名稱或長度超過 2 個字元的全名片段。雖然這些規則很明確,但要手動對每個候選密碼逐一驗證非常容易出錯,特別是當使用者嘗試重複使用舊密碼或僅做小幅修改時。密碼強度檢查工具會自動執行這項驗證,標記出任何未符合的規則並說明原因,讓您可以在嘗試於 Active Directory 中設定密碼之前先加以修正。
除了內建規則之外,安全性最佳實務也建議使用更長的密碼(至少 12 個字元)、避免使用字典中的單字,並遠離常見的鍵盤模式。此工具的回饋反映了這些建議,顯示字元類型的詳細說明,以及一個會標記出明顯序列(例如 "12345" 或 "qwerty")的模式旗標。這項回饋符合 NIST 特別出版品 800-63B,該標準不鼓勵過於複雜的規則,而是傾向於長度與不可預測性。例如,像 "P@ssw0rd" 這樣的密碼雖然可能通過 Active Directory 的複雜度規則,但仍會被工具標記,因為它包含常見的字典單字以及可預測的替換。透過及早發現這些問題,您可以引導使用者設定更強的密碼,使其較不容易在暴力破解或字典攻擊中被破解。

Active Directory 密碼複雜度的運作方式
Active Directory 的密碼複雜度是由一個內建的動態連結程式庫(passfilt.dll)強制執行的,該程式庫會在每個網域控制站上執行。當使用者提交新密碼時,網域控制站會呼叫此程式庫,根據前述 6 項規則驗證密碼。如果違反任何規則,變更將會被拒絕,並顯示一則說明未達成的特定需求的錯誤訊息(例如「密碼不符合密碼原則的需求。請檢查最小密碼長度、密碼複雜度與密碼歷程記錄需求」)。這項強制執行作業即時進行,因此除非修改網域密碼原則本身,否則無法繞過。
您可以使用群組原則管理主控台(gpmc.msc)來查看與修改預設原則。若要檢查目前的設定,請導覽至電腦設定 → 原則 → Windows 設定 → 安全性設定 → 帳戶原則 → 密碼原則。在這裡,您會看到最小密碼長度、密碼歷程記錄,以及密碼複雜度是否已啟用。如果已啟用複雜度,6 項規則將會自動強制執行。重要的是要注意,這些規則僅適用於網域中的使用者帳戶;成員伺服器或工作站上的本機帳戶則遵循本機安全性原則,該原則可能會有不同的設定。
雖然預設規則提供了基本的安全性,但它們並非萬無一失。例如,像 "Summer2024!" 這樣的密碼雖然符合所有 6 項要求,但仍然很弱,因為它包含常見的字典單字和可預測的模式(年份)。這就是為什麼像密碼強度檢查工具這類額外的工具非常有價值:它們提供超越基本規則的回饋,幫助使用者建立真正能抵禦攻擊的密碼。對於需要更高安全性的組織,Microsoft 提供了 Azure AD Password Protection,它可以封鎖出現在已知外洩清單中或符合常見模式的密碼,即使這些密碼符合預設的複雜度規則。
如何在提交至 Active Directory 之前檢查密碼複雜度
若要在本機驗證候選密碼是否符合 Active Directory 的複雜度規則,請依照下列步驟使用密碼強度檢查工具:
- 在您的瀏覽器中開啟密碼強度檢查工具。不需要安裝或註冊。
- 在輸入欄位中輸入或貼上候選密碼。密碼預設為隱藏狀態;如果您需要確認輸入的內容,請按下「顯示」按鈕。
- 檢閱輸入欄位下方的回饋面板。工具會立即顯示:
- 總字元數以及是否符合最小長度需求(Active Directory 為 6 個字元)。
- 字元類型的細項(大寫、小寫、數字、符號),以及是否至少包含 4 個類型中的 3 個。
- 模式旗標,標記出明顯的重複或連續字元(例如 "aaa"、"123"、"qwerty")。
- 具體建議,例如增加長度或避免使用字典單字。
- 如果未符合任何規則,工具會說明是哪一項規則以及未通過的原因。例如,如果密碼缺少數字,它會顯示「缺少:至少 1 個數字」。請據此調整密碼並重新檢查。
- 一旦密碼通過所有檢查,您就可以放心地將其用於 Active Directory 的密碼變更或重設。為了提升安全性,請將密碼透過帳戶提供者的外洩檢查工具(例如 Microsoft 的「Password Protection」功能或像 Have I Been Pwned 這類的第三方服務)進行檢查,以確保它未在資料外洩事件中曝光。
- 將密碼儲存在值得信賴的密碼管理工具中,並為帳戶啟用多因子認證。請勿僅依賴此工具的評分——請將其視為指導原則,而非安全性的保證。
常見陷阱與避免方法
即使密碼符合 Active Directory 的複雜度規則,它仍然可能很弱。以下是一些常見的陷阱以及避免方法:
| 陷阱 | 問題所在 | 如何避免 |
|---|---|---|
| 使用字典中的單字或姓名 | 字典攻擊可以在幾秒鐘內破解像 "Password123!" 這類密碼,即使它們符合複雜度規則。 | 避免使用常見的單字、姓名或詞彙。請使用隨機單字組成的密碼片語(例如 "CorrectHorseBatteryStaple"),或使用密碼管理工具來產生真正隨機的字串。 |
| 可預測的替換(例如用 "@" 代替 "a") | 攻擊者知道常見的替換(例如 "P@ssw0rd"),並能在暴力破解攻擊中加以考量。 | 完全避免使用替換。請著重於長度與隨機性。例如,"Tr0ub4dor&3" 比 "troubadorandthree" 來得弱。 |
| 鍵盤模式(例如 "qwerty"、"12345") | 這些模式易於猜測,通常是暴力破解攻擊中最先嘗試的組合。 | 使用密碼強度檢查工具的模式旗標來識別並移除這些序列。請改用隨機組合。 |
| 重複使用舊密碼或僅做小幅修改 | 如果舊密碼已遭外洩,攻擊者可以輕易猜中其變化(例如 "Password2023" 已外洩,則 "Password2024" 也可能被破解)。 | 務必建立一個全新的密碼。使用密碼管理工具為每個帳戶產生並儲存唯一的密碼。 |
| 只重視複雜度而忽略長度 | 一個使用複雜字元的短密碼(例如 "P@ss1")比一個較長但較簡單的密碼(例如 "ThisIsALongPassword")更容易被破解。 | 長度優先於複雜度。即使密碼僅包含小寫字母與空格,目標也應至少達到 12 個字元。 |
另一個常見的錯誤是認為符合 Active Directory 的規則就足夠了。雖然預設原則提供了基本的安全性,但對於現代的安全性威脅而言並不充足。例如,像 "Company2024!" 這樣的密碼雖然可能通過複雜度檢查,但仍然很弱,因為它包含字典單字、可預測的模式(年份)以及常見的符號。密碼強度檢查工具透過提供超越基本規則的回饋,協助您識別這些問題。此外,組織也應考慮實施額外的防護措施,例如 Azure AD Password Protection,它可以封鎖出現在已知外洩清單中或符合常見模式的密碼。
How to Enforce Stronger Passwords in Active Directory
If you want to go beyond the default complexity rules, you can customize the Active Directory password policy using Group Policy. Here’s how to enforce stronger passwords:
- Open the Group Policy Management Console (gpmc.msc) on a domain controller or a machine with the Remote Server Administration Tools (RSAT) installed.
- Navigate to Computer Configuration → Policies → Windows Settings → Security Settings → Account Policies → Password Policy.
- Double-click "Minimum password length" and set it to at least 12 characters. Longer passwords are significantly harder to crack, even if they are less complex.
- Enable "Password must meet complexity requirements" if it is not already enabled. This enforces the six default rules mentioned earlier.
- Consider enabling "Store passwords using reversible encryption" only if required by legacy applications, as this setting weakens security.
- To enforce additional rules, such as blocking common passwords or patterns, you can use a third-party password filter or Microsoft’s Azure AD Password Protection. This service integrates with Active Directory and blocks passwords that appear in known breach lists or that match common patterns, even if they meet the default complexity rules.
- After making changes, link the Group Policy Object (GPO) to the appropriate organizational units (OUs) and run
gpupdate /forceon domain controllers and client machines to apply the changes immediately.
For organizations using Azure AD, you can also enforce password policies through Azure AD Password Protection. This service allows you to define custom banned password lists and block passwords that match common patterns. To set it up, follow these steps:
- Sign in to the Azure portal (portal.azure.com) as a global administrator.
- Navigate to Azure Active Directory → Security → Authentication methods → Password protection.
- Enable "Enforce custom list" and add any custom banned passwords specific to your organization (e.g., company name, product names).
- Enable "Enable password protection on Windows Server Active Directory" and download the proxy service and DC agent from the Microsoft Download Center.
- Install the proxy service on a member server and the DC agent on all domain controllers. The agents will communicate with Azure AD to enforce the banned password list.
By combining Active Directory’s built-in complexity rules with additional protections like Azure AD Password Protection, you can significantly reduce the risk of weak passwords in your environment. However, no technical measure can replace user education. Teach users the importance of strong passwords, how to create them, and how to use password managers to store them securely. The Password Generator tool can also help users create strong, random passwords locally without relying on predictable patterns.
Beyond Complexity: Additional Security Measures
While password complexity is important, it is only one part of a comprehensive security strategy. Here are some additional measures to consider:
- Multi-Factor Authentication (MFA): MFA adds an extra layer of security by requiring a second form of authentication, such as a text message, app notification, or hardware token. Even if a password is compromised, MFA can prevent unauthorized access. Enable MFA for all accounts, especially those with administrative privileges.
- Password Managers: Password managers generate, store, and autofill strong, unique passwords for each account. This eliminates the need for users to remember passwords and reduces the risk of password reuse. Encourage users to adopt a reputable password manager and provide training on how to use it effectively.
- Breach Monitoring: Use services like Have I Been Pwned or Microsoft’s built-in breach monitoring to check if a password has been exposed in a data breach. These services compare passwords against known breach lists and alert users if their password is compromised. The Password Strength Checker provides a link to Have I Been Pwned’s API for this purpose.
- Regular Password Changes: While frequent password changes are no longer recommended by NIST for most users, they can still be useful for high-risk accounts, such as those with administrative privileges. For regular users, focus on password strength and MFA instead of forced rotation.
- User Education: Teach users how to create strong passwords, recognize phishing attempts, and use security tools like MFA and password managers. Regular training and awareness campaigns can significantly reduce the risk of human error.
For organizations that need to audit existing passwords for weakness, tools like SHA256 Hash Generator can help. By generating hashes of known weak passwords and comparing them to hashes stored in Active Directory, you can identify accounts that may be at risk. However, this approach requires careful handling to avoid exposing sensitive data. Always follow best practices for password auditing and consult with security professionals if you are unsure.
In summary, checking password complexity in Active Directory is a critical step in maintaining a secure environment. The Password Strength Checker tool provides a fast, local way to verify whether a proposed password meets the domain’s requirements, along with additional feedback to help users create stronger passwords. By combining this tool with other security measures like MFA, password managers, and breach monitoring, you can significantly reduce the risk of weak passwords in your organization.
See also: How Binary to Text Conversion Works in Plain English.
Related reading: Check Office 365 Password Strength Before You Submit It.