πPassword Policy Enumeration
π Overview
Password policy enumeration is a critical reconnaissance step in Active Directory assessments. Understanding the domain's password requirements, lockout thresholds, and complexity rules helps determine the feasibility of password spraying attacks and guides credential attack strategies.
π― Why Password Policies Matter
π Assessment Value
Password Spraying Planning: Determines safe attack parameters
Lockout Avoidance: Critical for maintaining stealth
Attack Vector Selection: Influences credential attack methodology
Risk Assessment: Weak policies indicate higher security risk
β οΈ Key Policy Settings
Minimum Password Length: Affects password complexity
Lockout Threshold: Maximum failed attempts before lockout
Lockout Duration: How long accounts remain locked
Password Complexity: Character requirements
Password History: Prevents password reuse
π§ Linux-Based Enumeration
π Credentialed Enumeration
CrackMapExec - Password Policy
Example Output:
π SMB NULL Session Enumeration
rpcclient - NULL Session
enum4linux - Legacy Tool
Key Output:
enum4linux-ng - Modern Rewrite
YAML/JSON Output:
Tool Port Usage
Tool
Ports
nmblookup
137/UDP
nbtstat
137/UDP
net
139/TCP, 135/TCP, 49152-65535
rpcclient
135/TCP
smbclient
445/TCP
π LDAP Anonymous Bind
ldapsearch - LDAP Query
Example Output:
Note: In newer versions, use -H ldap://IP instead of -h IP
πͺ Windows-Based Enumeration
π NULL Session from Windows
net use Command
Common Error Messages
π Credentialed Windows Enumeration
net.exe - Built-in Tool
Example Output:
PowerView - PowerShell Module
Example Output:
π Password Policy Analysis
π INLANEFREIGHT.LOCAL Analysis
Setting
Value
Implication
Minimum Length
8 characters
Allows weak passwords like Welcome1
Lockout Threshold
5 attempts
Safe for 2-3 password spraying attempts
Lockout Duration
30 minutes
Accounts auto-unlock (no admin required)
Password Complexity
Enabled
3/4 character types required
Password History
24 passwords
Prevents immediate reuse
Maximum Age
Unlimited
Passwords never expire
β οΈ Password Spraying Implications
Safe Attempt Count: 2-3 attempts per user
Wait Time: 31+ minutes between spray rounds
Target Passwords:
Welcome1,Password1,Company1Risk Level: Low (auto-unlock, high threshold)
π Default Domain Password Policy
Policy
Default Value
Enforce password history
24 days
Maximum password age
42 days
Minimum password age
1 day
Minimum password length
7
Password complexity
Enabled
Store passwords using reversible encryption
Disabled
Account lockout duration
Not set
Account lockout threshold
0
Reset account lockout counter
Not set
π― HTB Academy Lab Walkthrough
π Lab Questions
Question 1: "What is the default Minimum password length when a new domain is created?"
Question 2: "What is the minPwdLength set to in the INLANEFREIGHT.LOCAL domain?"
π Step-by-Step Solution
1οΈβ£ Connect to Target
2οΈβ£ Method 1: enum4linux
3οΈβ£ Method 2: rpcclient NULL Session
4οΈβ£ Method 3: ldapsearch
5οΈβ£ Method 4: enum4linux-ng
β
Answers
Default minimum password length:
7INLANEFREIGHT.LOCAL minPwdLength:
8
π‘οΈ Password Policy Best Practices
β
Strong Policy Recommendations
Minimum Length: 12-14 characters
Lockout Threshold: 3-5 attempts
Lockout Duration: 15-30 minutes
Complexity: Enable but educate users
Password Age: 90-180 days maximum
π« Disable Legacy Features
SMB NULL Sessions: Prevent anonymous access
LDAP Anonymous Bind: Require authentication
LM Hash Storage: Use only NTLM/NTLMv2
Reversible Encryption: Never enable
π§ Group Policy Hardening
π Detection & Monitoring
π Event IDs to Monitor
4625: Failed logon attempts
4740: Account lockout events
4767: Account unlock events
4724: Password reset attempts
π¨ Anomaly Detection
Multiple failed authentications from single source
Unusual authentication patterns across multiple accounts
Service account lockouts (often indicates spraying)
Authentication attempts outside business hours
π Baseline Metrics
Normal failed authentication rates
Typical lockout frequencies
Service account authentication patterns
Geographic authentication patterns
β‘ Quick Reference Commands
π§ Linux Enumeration
πͺ Windows Enumeration
π Key Takeaways
β
Enumeration Success Factors
Multiple Methods: Try various approaches (SMB, LDAP, RPC)
Legacy Misconfigurations: NULL sessions often work on older domains
Tool Redundancy: Use both traditional and modern tools
Credential Context: Some methods require authentication
β οΈ Critical Considerations
Lockout Avoidance: Never exceed safe attempt thresholds
Stealth Operations: Avoid generating excessive authentication logs
Policy Documentation: Record all discovered settings for planning
Client Communication: Confirm lockout policies when possible
π― Next Steps
User Enumeration: Gather target user lists
Password List Creation: Build spraying wordlists
Attack Timing: Plan spray intervals based on lockout policy
Monitoring Setup: Watch for defensive responses
Understanding the password policy is fundamental to safe and effective credential attacks in Active Directory environments.
Last updated