πŸ”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, Company1

  • Risk 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

  1. Default minimum password length: 7

  2. INLANEFREIGHT.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

  1. User Enumeration: Gather target user lists

  2. Password List Creation: Build spraying wordlists

  3. Attack Timing: Plan spray intervals based on lockout policy

  4. Monitoring Setup: Watch for defensive responses


Understanding the password policy is fundamental to safe and effective credential attacks in Active Directory environments.

Last updated