Attacking Active Directory (AD)
Overview
This comprehensive guide covers Active Directory architecture, enumeration, and attack techniques. Understanding these concepts is essential for both offensive security assessments and defensive operations.
Learning Workflow
Phase 1: Foundations — AD architecture, domains, forests, trusts Phase 2: Objects — Users, groups, computers, services Phase 3: Infrastructure — Database, address resolution, protocols Phase 4: Authentication — NTLM, Kerberos, delegation Phase 5: Authorisation — ACLs, privileges, Group Policy
What is Active Directory?
Active Directory (AD) is Microsoft's directory service for Windows domain networks. It stores information about network objects (users, computers, groups, services) and provides authentication and authorisation services.
Core Components:
Directory Service (AD DS): Stores and manages objects
Authentication: Validates user/computer identity (Kerberos, NTLM)
Authorisation: Determines access rights (ACLs, Group Policy)
Replication: Synchronises data across Domain Controllers
DNS Integration: Name resolution for AD services
Why Attackers Target AD:
Centralised authentication = single point of compromise
Credential caching enables lateral movement
Trust relationships extend the attack surface
Misconfigurations are common and exploitable
Domain Admin = complete network control
Domains
A domain is the core administrative unit in Active Directory—a logical grouping of objects (users, computers, groups) that share a common directory database, security policies, and trust relationships.
Domain Name
Domains have two naming conventions:
DNS Name
corp.contoso.com
Network communication, Kerberos
NetBIOS Name
CORP
Legacy compatibility, NTLM
Domain Components:
Domain Controllers (DCs): Host AD DS, handle authentication
Member Servers: Domain-joined but don't run AD DS
Workstations: Domain-joined client computers
Organisational Units (OUs): Containers for organising objects
Forests
A forest is the top-level container in AD—a collection of one or more domains that share a standard schema, configuration, and Global Catalogue—all domains in a forest trust each other (transitive trust).
Forest Components:
Schema: Defines object classes and attributes (forest-wide)
Configuration: Forest topology, sites, services
Global Catalogue: Partial replica of all domain objects
Forest Root Domain: First domain created, contains Enterprise Admins
Functional Modes
Functional levels determine which AD features are available and which DC versions are supported.
Forest Functional Levels
Windows 2000
Windows 2000
Basic AD
Windows 2003
Windows Server 2003
Forest trusts, linked-value replication
Windows 2008
Windows Server 2008
DFS-R for SYSVOL
Windows 2008 R2
Windows Server 2008 R2
AD Recycle Bin
Windows 2012
Windows Server 2012
-
Windows 2012 R2
Windows Server 2012 R2
Authentication policies
Windows 2016
Windows Server 2016
Privileged Access Management
Domain Functional Levels
Windows 2000 Native
Universal groups, group nesting
Windows 2003
lastLogonTimestamp, constrained delegation
Windows 2008
AES Kerberos, fine-grained password policies
Windows 2008 R2
Authentication mechanism assurance
Windows 2012
KDC support for claims
Windows 2012 R2
Protected Users group, authentication policies
Windows 2016
Smart card required for interactive logon
Trusts
Trusts enable users in one domain to access resources in another domain. They define authentication pathways between domains.
Trust Direction
One-way incoming
Trusting domain trusts trusted domain
Users from trusted → access trusting
One-way outgoing
Trusted domain is trusted by trusting domain
Users from this domain → access other
Two-way
Bidirectional trust
Users can authenticate in either direction
Trust Transitivity
Transitive
Trust extends to other trusted domains (A trusts B, B trusts C → A trusts C)
Non-transitive
Trust limited to the two domains only
Trust Types
Parent-Child
Two-way
Transitive
Automatic between parent and child domains
Tree-Root
Two-way
Transitive
Between forest root and new tree root
Shortcut
One/Two-way
Transitive
Optimize authentication in large forests
External
One/Two-way
Non-transitive
To external AD domain (non-forest)
Forest
One/Two-way
Transitive
Between forest root domains
Realm
One/Two-way
Transitive/Non
To non-Windows Kerberos realm
Trust Key
Trusts are secured with a shared secret (trust key) used to encrypt inter-realm TGTs.
Stored as a trust account password in both domains
Used to generate Kerberos keys for cross-domain tickets
Compromising trust keys enables golden ticket attacks across domains
More on Trusts
Trust Enumeration for Attacks
Trust Attack Paths
SID History Injection: Inject privileged SIDs from a trusted domain
Foreign Group Membership: Users from a trusted domain in privileged groups
Trust Key Extraction: DCSync/mimikatz to get trust account hash
Kerberos Ticket Forgery: Golden tickets with cross-domain SIDs
Users
User objects represent security principals that can authenticate to the domain.
User Properties
User Identifiers
SID
Security Identifier (unique, permanent)
S-1-5-21-....-1104
sAMAccountName
Pre-Windows 2000 logon name
jsmith
userPrincipalName
UPN format
jsmith@corp.contoso.com
distinguishedName
LDAP path
CN=John Smith,OU=Users,DC=corp,DC=contoso,DC=com
objectGUID
Globally unique identifier
{GUID}
RID
Relative ID (last part of SID)
1104
User Secrets
LM/NT Hashes
LM Hash
Legacy, DES-based, case-insensitive
Weak, disabled by default (Vista+)
NT Hash
MD4 hash of Unicode password
Better, still no salt
Dumping Hashes:
Kerberos Keys
Derived from user password + salt (domain + username):
AES256-CTS-HMAC-SHA1-96
AES 256-bit
Modern Kerberos
AES128-CTS-HMAC-SHA1-96
AES 128-bit
Modern Kerberos
RC4-HMAC (arcfour)
NT Hash
Legacy compatibility
DES-CBC-MD5
DES
Very old systems
UserAccountControl
Bitmask attribute controlling account behaviour.
ACCOUNTDISABLE
0x0002
Account disabled
LOCKOUT
0x0010
Account locked
PASSWD_NOTREQD
0x0020
No password required
PASSWD_CANT_CHANGE
0x0040
User can't change password
ENCRYPTED_TEXT_PWD_ALLOWED
0x0080
Reversible encryption
NORMAL_ACCOUNT
0x0200
Standard user account
DONT_EXPIRE_PASSWORD
0x10000
Password never expires
TRUSTED_FOR_DELEGATION
0x80000
Unconstrained delegation
NOT_DELEGATED
0x100000
Account cannot be delegated
USE_DES_KEY_ONLY
0x200000
DES encryption only
DONT_REQ_PREAUTH
0x400000
No Kerberos pre-auth (ASREProastable)
TRUSTED_TO_AUTH_FOR_DELEGATION
0x1000000
Constrained delegation (S4U2Self)
Other User Properties
servicePrincipalName
Kerberoastable if set
msDS-AllowedToDelegateTo
Constrained delegation targets
msDS-AllowedToActOnBehalfOfOtherIdentity
RBCD targets
adminCount
AdminSDHolder protected
memberOf
Group memberships
pwdLastSet
Password age
lastLogon
Activity indicator
logonCount
Activity indicator
description
Often contains passwords
Important Users
Built-in Privileged Users
Administrator
500
Built-in domain admin
krbtgt
502
KDC service account (golden ticket target)
Guest
501
Disabled by default
Service Accounts to Target
Service Accounts
SPNs, often weak passwords
Kerberoast
gMSA
Managed passwords
Harder to compromise
Computer Accounts
Machine account
Password in registry
Computer Accounts
Computer accounts are security principals for domain-joined machines.
Properties:
Name ends with
$(e.g.,WORKSTATION01$)Password: 120+ character random, auto-rotated every 30 days
Stored in HKLM\SECURITY\Policy\Secrets$MACHINE.ACC
SPN:
HOST/computername,HOST/computername.domain.com
Trust Accounts
Each trust creates a trust account in both domains (named after the trusted domain with $).
Groups
Groups are collections of users, computers, or other groups used for access control and management.
Important Groups
Administrative Groups
Domain Admins
Global
Full control of domain
Enterprise Admins
Universal (forest root)
Full control of forest
Schema Admins
Universal (forest root)
Can modify AD schema
Administrators
Domain Local
Local admin on DCs
Account Operators
Domain Local
Create/manage users and groups
Backup Operators
Domain Local
Backup/restore files, DCSync potential
Server Operators
Domain Local
Manage domain servers
Print Operators
Domain Local
Manage printers, load drivers
Other Important Groups
Domain Controllers
All DCs in domain
Domain Computers
All workstations
Domain Users
All domain users
Protected Users
Enhanced credential protection
Group Policy Creator Owners
Create/modify GPOs
DnsAdmins
DNS management, code execution potential
Remote Desktop Users
RDP access
Remote Management Users
WinRM access
Cert Publishers
Certificate publishing
Exchange Windows Permissions
Often has WriteDacl on domain
Group Scope
Domain Local
Users/groups from any domain
Same domain only
Global
Users/groups from same domain
Any domain in forest
Universal
Users/groups from any domain
Any domain in forest
Computers
Domain Controllers
Domain Controllers (DCs) host Active Directory Domain Services and handle authentication requests.
Domain Controllers Discovery
Domain Database Dumping
The AD database (NTDS.dit) contains all domain secrets.
Windows Computers
Windows Computers Discovery
Windows Computers Connection
Connecting with RPC/SMB
Connecting with PowerShell Remoting
Connecting with RDP
Windows Computers Credentials
LSASS Credentials
LSASS (Local Security Authority Subsystem Service) caches credentials for SSO.
Registry Credentials
LSA Secrets
Stored in HKLM\SECURITY\Policy\Secrets:
Service account passwords
Auto-logon credentials
Machine account password
DPAPI master keys
SAM
Local account hashes in HKLM\SAM:
Dumping Registry Credentials
PowerShell History
Other Places to Find Credentials in Windows
%USERPROFILE%\AppData\Local\Microsoft\Credentials\
DPAPI-protected credentials
%USERPROFILE%\AppData\Roaming\Microsoft\Credentials\
DPAPI-protected credentials
C:\Windows\Panther\unattend.xml
Setup credentials
C:\Windows\Panther\Unattended.xml
Setup credentials
%WINDIR%\sysprep\sysprep.xml
Sysprep credentials
%WINDIR%\sysprep\sysprep.inf
Sysprep credentials
C:\inetpub\wwwroot\web.config
Web app credentials
%USERPROFILE%\.aws\credentials
AWS credentials
%USERPROFILE%\.azure\
Azure credentials
Group Policy Preferences
Encrypted (decryptable) passwords
Scheduled Tasks
Service account credentials
Windows Vault
Web credentials
Linux Computers
Linux Computers Discovery
Linux Computers Connection
Linux Computers Credentials
Linux Kerberos Tickets
Linux User Files
SSH Keys
Bash History
Other Places to Find Credentials in Linux
/etc/sssd/sssd.conf
AD integration credentials
/etc/krb5.conf
Kerberos configuration
/etc/samba/smb.conf
Samba configuration
~/.pgpass
PostgreSQL credentials
~/.my.cnf
MySQL credentials
~/.netrc
FTP credentials
~/.aws/credentials
AWS credentials
/var/log/auth.log
Authentication attempts
/etc/openldap/ldap.conf
LDAP configuration
Environment variables
API keys, tokens
Services
Host Service
The HOST SPN is an alias that includes multiple services:
alerter
Alerter service
appmgmt
Application Management
cisvc
Indexing Service
clipsrv
ClipBook
browser
Computer Browser
dhcp
DHCP Server
dnscache
DNS Client
replicator
Directory Replicator
eventlog
Event Log
eventsystem
COM+ Event System
policyagent
IPSec Policy Agent
oakley
ISAKMP/Oakley
dmserver
Logical Disk Manager
messenger
Messenger
netman
Network Connections
nla
Network Location Awareness
rpc
Remote Procedure Call
rpclocator
RPC Locator
remoteaccess
Routing and Remote Access
rsvp
RSVP QoS
samss
SAM
scardsvr
Smart Card
scesrv
Security Configuration
seclogon
Secondary Logon
scm
Service Control Manager
dcom
Server service (DCOM)
spooler
Print Spooler
snmp
SNMP Trap
schedule
Task Scheduler
tapisrv
Telephony
trksvr
Distributed Link Tracking Server
trkwks
Distributed Link Tracking Client
ntdsa
Active Directory
ups
UPS
time
Windows Time
wins
Windows Wins
www
IIS
Database
The Active Directory database (NTDS.dit) stores all domain objects using the Extensible Storage Engine (ESE).
Classes
Object classes define what type of object can be created and what attributes it can have.
user
User accounts
sAMAccountName, userPrincipalName, unicodePwd
computer
Computer accounts
dNSHostName, operatingSystem
group
Security groups
member, groupType
organizationalUnit
Containers
gpLink
domainDNS
Domain object
objectSid, fSMORoleOwner
trustedDomain
Trust objects
trustDirection, trustType
groupPolicyContainer
GPOs
gPCFileSysPath
Properties
Attributes store object information. Key security-relevant attributes:
unicodePwd
User
NT hash (encrypted)
ntPwdHistory
User
Password history
dBCSPwd
User
LM hash
supplementalCredentials
User
Kerberos keys
msDS-AllowedToDelegateTo
User/Computer
Constrained delegation
msDS-AllowedToActOnBehalfOfOtherIdentity
Computer
RBCD
userAccountControl
User/Computer
Account flags
servicePrincipalName
User/Computer
SPNs
nTSecurityDescriptor
All
Security descriptor (ACL)
adminCount
User/Group
Protected by AdminSDHolder
Principals
Security principals are objects that can be assigned permissions and authenticate.
SID
Security Identifier - unique identifier for principals.
Well-Known SIDs:
S-1-5-21-<domain>-500
Domain Administrator
S-1-5-21-<domain>-502
krbtgt
S-1-5-21-<domain>-512
Domain Admins
S-1-5-21-<domain>-513
Domain Users
S-1-5-21-<domain>-516
Domain Controllers
S-1-5-21-<domain>-519
Enterprise Admins
S-1-5-32-544
Administrators
S-1-5-32-545
Users
S-1-5-18
Local System
S-1-5-19
Local Service
S-1-5-20
Network Service
Distinguished Names
LDAP path to an object.
Partitions
Domain
Domain-specific objects
Domain DCs only
Configuration
Forest topology, sites
All DCs in forest
Schema
Object definitions
All DCs in forest
Application
Custom partitions (DNS zones)
Configurable
Global Catalog
Partial read-only replica of all objects in the forest (subset of attributes).
Runs on port 3268 (LDAP) / 3269 (LDAPS)
Used for forest-wide searches
Used for UPN authentication
Contains membership of universal groups
How to Query the Database?
LDAP
Lightweight Directory Access Protocol - primary method for AD queries.
Ports:
389: LDAP
636: LDAPS (SSL)
3268: Global Catalog
3269: Global Catalog SSL
ADWS
Active Directory Web Services - SOAP-based interface (PowerShell remoting).
Port 9389
Used by Active Directory module for PowerShell
Requires AD Web Services role
Other Protocols
Kerberos
88
Authentication, principal enumeration
DNS
53
SRV records, zone transfers
SMB
445
Share enumeration, file access
RPC
135
SAMR, DRSUAPI, LSARPC
NetBIOS
137-139
Legacy name resolution
Security
Active Directory security relies on multiple layers:
Authentication
Kerberos, NTLM, certificates
Authorization
ACLs, privileges, Group Policy
Encryption
TLS/SSL, Kerberos encryption, LDAPS
Auditing
Security event logs, advanced audit policies
Tiering
Administrative tier model
Address Resolution
ARP
Address Resolution Protocol - maps IP addresses to MAC addresses on local networks.
ARP Spoof
Redirect traffic by sending fake ARP replies.
ARP Scan
Discover hosts on local network.
DHCP
Dynamic Host Configuration Protocol - assigns IP addresses and network configuration.
Rogue DHCP Server
Deploy malicious DHCP server to control client network configuration.
DHCP Starvation
Exhaust DHCP pool to enable rogue server.
DHCP Discovery
Identify DHCP servers.
DHCP Dynamic DNS
DHCP can update DNS records (DDNS), potentially allowing DNS poisoning.
DNS
Domain Name System - critical for AD functionality.
DNS Basics
AD integrates DNS for service location:
A
Host to IP
dc01.domain.com → 192.168.1.1
AAAA
Host to IPv6
dc01.domain.com → fe80::1
CNAME
Alias
mail.domain.com → exchange.domain.com
SRV
Service location
_ldap._tcp.domain.com
MX
Mail server
domain.com → mail.domain.com
PTR
IP to host
1.1.168.192.in-addr.arpa → dc01.domain.com
NS
Name server
domain.com → dc01.domain.com
SOA
Zone authority
Zone metadata
Critical AD SRV Records:
DNS Zones
Forward Lookup
Name to IP resolution
Reverse Lookup
IP to name resolution
AD-Integrated
Stored in AD, replicated automatically
Primary
Authoritative, read-write
Secondary
Copy of primary, read-only
Stub
Contains only NS records
DNS Exfiltration
Exfiltrate data through DNS queries.
Fake DNS Server
Respond to DNS queries with malicious answers.
DNS Zone Transfer
Request full copy of DNS zone.
Dump DNS Records
Enumerate DNS records.
ADIDNS
Active Directory Integrated DNS - DNS zones stored in AD.
Attack vectors:
Add DNS records (if user has permissions)
Modify existing records
Create wildcard records for LLMNR/NBT-NS style attacks
DNS Dynamic Updates
DNS records can be updated dynamically.
NetBIOS
Legacy name resolution protocol.
NetBIOS Datagram Service
Port 138 UDP - broadcasts and datagram messaging.
NetBIOS Session Service
Port 139 TCP - session establishment for SMB (legacy).
NetBIOS Name Service
Port 137 UDP - name registration and resolution.
LLMNR
Link-Local Multicast Name Resolution - resolves names when DNS fails.
Multicast to 224.0.0.252 (IPv4) / ff02::1:3 (IPv6)
Port 5355 UDP
No authentication - vulnerable to spoofing
mDNS
Multicast DNS - Apple Bonjour, zero-configuration networking.
Multicast to 224.0.0.251 (IPv4) / ff02::fb (IPv6)
Port 5353 UDP
Used for
.localdomain
WPAD
Web Proxy Auto-Discovery - automatic proxy configuration.
Attack: Respond to WPAD queries with a malicious proxy.
Authentication
GSS-API/SSPI
Generic Security Service API / Security Support Provider Interface - an abstraction layer for authentication.
Windows SSPs
Security Support Providers implement authentication protocols.
Kerberos SSP
Default for domain authentication.
Ticket-based
Mutual authentication
Requires KDC (Domain Controller)
NTLM SSP
Legacy challenge-response authentication.
Password hash-based
No mutual authentication
Works without DC connectivity
Negotiate SSP
Negotiates between Kerberos and NTLM.
Prefers Kerberos
Falls back to NTLM
Most common SSP used
Digest SSP
HTTP Digest authentication.
Requires reversible encryption
Rarely used in AD
Secure Channel SSP
SSL/TLS authentication (Schannel).
Certificate-based
Machine authentication
Cred SSP
Credential delegation for RDP/WinRM.
Sends credentials to server
Dangerous if server compromised
Custom SSPs
Third-party or malicious SSPs.
Can capture credentials
Persistence mechanism
SPNEGO
Simple and Protected GSSAPI Negotiation Mechanism.
Wraps GSS-API negotiation
Used by Negotiate SSP
Seen in HTTP (WWW-Authenticate: Negotiate)
NTLM
NT LAN Manager - challenge-response authentication protocol.
NTLM Basics
NTLM Authentication Flow:
Client sends NEGOTIATE message (supported features)
Server sends CHALLENGE message (random 8/16 byte challenge)
Client sends AUTHENTICATE message (response using password hash)
NTLMv1
Security: Weak, vulnerable to rainbow tables.
24-byte response
Uses DES with NT hash as key
Can be cracked to recover NT hash
NTLMv2
Security: Better, but still relay-vulnerable.
Variable length response
Includes timestamp (replay protection)
Username/domain in calculation
MIC
Message Integrity Code - prevents relay message tampering.
HMAC-MD5 of all three NTLM messages
Optional flag in NTLMv2
Can be removed by attacker (drop flag)
NTLM in Active Directory
NTLM is used when:
Kerberos unavailable (no DC, IP instead of hostname)
Legacy systems
Cross-forest authentication (sometimes)
Local account authentication
NTLM Attacks
NTLM Recon
NTLM Brute-Force
Pass the Hash
Use NT hash directly without cracking.
NTLM Relay
Relay captured NTLM authentication to another service.
NTLM Relay Protections
SMB Signing
Signs SMB packets
Cannot relay to SMB signing required hosts
LDAP Signing
Signs LDAP packets
Cannot relay to LDAP
LDAP Channel Binding
Ties to TLS channel
Cannot relay to LDAPS
EPA (Extended Protection)
Channel binding for HTTP
Cannot relay across channels
Session Security
NTLMv2 session security
-
NTLM Hashes Cracking
Kerberos
Kerberos is the default authentication protocol in Active Directory.
Kerberos Basics
Kerberos Principals
Principals identify entities in Kerberos.
User
user@DOMAIN.COM
User principal
Service
service/host@DOMAIN.COM
Service principal
SPN
MSSQLSvc/sql.domain.com:1433
Service Principal Name
Tickets
Encrypted data structures proving identity.
PAC
Privilege Attribute Certificate - embedded in tickets, contains:
User SID
Group memberships
User rights
Signed by KDC (krbtgt key + service key)
Kerberos Actors
Client
Requests authentication
KDC (Key Distribution Center)
Domain Controller, issues tickets
AS (Authentication Service)
Part of KDC, issues TGTs
TGS (Ticket Granting Service)
Part of KDC, issues service tickets
Service
Target service
Ticket Types
ST (Service Ticket)
Used to access a specific service
Encrypted with the service account's key
Contains PAC and session key
TGT (Ticket Granting Ticket)
Used to request service tickets
Encrypted with the krbtgt account's key
Proves user identity to KDC
Ticket Acquisition
Kerberos Services
kerberos
88/TCP,UDP
Main Kerberos protocol
kpasswd
464/TCP,UDP
Password changes
Kerberos Keys
krbtgt
Golden ticket
Golden ticket
Golden ticket
Service account
Silver ticket
Silver ticket
Silver ticket
User
Authentication
Authentication
Pass the hash
Kerberos Basic Attacks
Kerberos Brute-Force
Kerberoast
Request service tickets for SPNs, crack offline.
Targeted Kerberoast (set SPN on the user you control):
ASREProast
Target accounts without pre-authentication required.
Targeted ASREProast (disable pre-auth on the user you control):
Pass the Key/Over Pass the Hash
Use Kerberos keys/NT hash to obtain TGT.
Pass the Ticket
Use stolen Kerberos tickets.
Golden/Silver Ticket
Golden Ticket: Forged TGT using krbtgt hash.
Silver Ticket: Forged ST using service account hash.
Kerberos Across Domains
SID History Attack
Inject privileged SIDs from another domain into the ticket.
Note: SID filtering may block this across forest trusts.
Inter-realm TGT
Request TGT for parent/trusted domain using trust key.
Kerberos Delegation
Delegation allows services to impersonate users to other services.
Kerberos Anti-Delegation Measures
NOT_DELEGATED flag
Account cannot be delegated
Protected Users group
No delegation, no NTLM, no DES
Account is sensitive
Cannot be delegated
Kerberos Unconstrained Delegation
Service stores user's TGT for any service.
Attack: Coerce privileged user to authenticate, steal TGT.
Kerberos Unconstrained Delegation Across Forests
If trust allows TGT delegation, can capture TGTs from users in trusted forest.
Kerberos Constrained Delegation
Service can only delegate to specific SPNs.
S4U2proxy
Request ST on behalf of user to allowed service.
S4U2self
Request ST to self on behalf of any user (if TRUSTED_TO_AUTH_FOR_DELEGATION).
S4U2self and S4U2proxy
Combined flow for full delegation without user interaction.
S4U Attacks
Alternative Service Attack: If delegated to time/target, request cifs/target instead.
Resource-Based Constrained Delegation (RBCD)
Delegation controlled by target service (msDS-AllowedToActOnBehalfOfOtherIdentity).
Logon Types
Different logon types have different credential caching behaviour.
2
Interactive
Yes (NT hash, Kerberos keys)
Console logon
3
Network
No
SMB, authenticated network
4
Batch
Yes
Scheduled tasks
5
Service
Yes
Service startup
8
NetworkCleartext
Yes (plaintext available)
IIS Basic auth
9
NewCredentials
Current + new
RunAs /netonly
10
RemoteInteractive
Yes
RDP
11
CachedInteractive
Domain cached creds
Offline domain logon
Interactive Logon
Physical/console logon. Credentials cached in LSASS.
Network Logon
SMB, remote access. Credentials NOT cached on target.
Batch Logon
Scheduled tasks. Credentials may be stored.
Service Logon
Service accounts. Credentials cached.
NetworkCleartext Logon
Plaintext over network (IIS Basic). Credentials cached in plaintext.
NewCredentials Logon
runas /netonly. Current token locally, different creds for network.
RemoteInteractive Logon
RDP. Full credentials cached unless Restricted Admin/Remote Credential Guard.
Authorization
ACLs
Access Control Lists determine who can access/modify objects.
Security Descriptor
Contains:
Owner: Who owns the object
DACL: Discretionary ACL (permissions)
SACL: System ACL (auditing)
ACEs
Access Control Entries - individual permission rules.
Allow
Grants permission
Deny
Explicitly denies
Rights
GenericAll
Full control
Modify anything
GenericWrite
Write properties
Modify SPNs, delegation
WriteProperty
Write specific property
Targeted modification
WriteDacl
Modify ACL
Grant yourself GenericAll
WriteOwner
Change owner
Take ownership, then WriteDacl
Self
Modify self
Add self to group
AllExtendedRights
All extended rights
Reset password, read LAPS
ForceChangePassword
Reset password
Take over account
AddMember
Add to group
Add self to privileged group
ReadLAPSPassword
Read LAPS
Get local admin password
ACL Attacks
Force password reset
ForceChangePassword
Set-ADAccountPassword
Add to group
AddMember/Self
Add-ADGroupMember
Set SPN (Kerberoast)
GenericWrite
Set-ADUser -ServicePrincipalNames
Disable pre-auth
GenericWrite
Set-ADAccountControl -DoesNotRequirePreAuth
Configure delegation
GenericWrite
Set delegation attributes
DCSync
Replicating Directory Changes (All)
secretsdump.py, mimikatz dcsync
Shadow Credentials
GenericWrite on computer
Add msDS-KeyCredentialLink
AdminSDHolder
Protects privileged accounts by resetting ACLs every 60 minutes.
Privileges
User rights assigned via Group Policy.
SeBackupPrivilege
High
Backup files, read DC database
SeRestorePrivilege
High
Restore files, write anywhere
SeTakeOwnershipPrivilege
High
Take ownership of any object
SeDebugPrivilege
Critical
Debug processes (inject into LSASS)
SeImpersonatePrivilege
Critical
Impersonate tokens (Potato attacks)
SeAssignPrimaryTokenPrivilege
Critical
Assign process tokens
SeLoadDriverPrivilege
Critical
Load kernel drivers
SeTcbPrivilege
Critical
Act as part of OS
SeEnableDelegationPrivilege
High
Configure delegation
Group Policy
Group Policy Objects (GPOs) apply configuration to users and computers.
GPO Scope
Site
AD site
Domain
Entire domain
OU
Organizational Unit (cascades)
Processing order: Local → Site → Domain → OU (LSDOU)
Group Policy Template
Files in SYSVOL (\domain\SYSVOL\domain\Policies{GUID}).
Group Policy Container
LDAP object storing GPO metadata.
GPO Attacks
Communication Protocols
SMB
Server Message Block - file sharing, named pipes, RPC transport.
Shares
Default Shares
C$
Default admin share (C: drive)
ADMIN$
%SystemRoot%
IPC$
Named pipes
PRINT$
Printer drivers
Default Domain Shares
NETLOGON
%SystemRoot%\SYSVOL\sysvol\domain\SCRIPTS
Logon scripts
SYSVOL
%SystemRoot%\SYSVOL\sysvol
GPOs, scripts
Named Pipes
IPC mechanism over SMB (\\.\pipe\pipename).
\PIPE\srvsvc
Server service
Share enumeration
\PIPE\samr
SAM
User enumeration
\PIPE\lsarpc
LSA
Policy enumeration
\PIPE\netlogon
Netlogon
ZeroLogon
\PIPE\spoolss
Print Spooler
PrintNightmare, coercion
\PIPE\efsrpc
EFS
PetitPotam
\PIPE\drsuapi
Directory Replication
DCSync
HTTP
Web services in an AD environment.
ADFS
443
Federation
ADCS Web Enrollment
80/443
Certificate requests
Exchange OWA
443
SharePoint
80/443
Collaboration
RPC
Remote Procedure Call - invoke functions remotely.
RPC over SMB
Transport via named pipes (port 445).
RPC over TCP
Dynamic ports (RPC Endpoint Mapper on 135).
WinRM
Windows Remote Management - WS-Management protocol.
5985
HTTP
5986
HTTPS
PowerShell Remoting
Uses WinRM for remote PowerShell sessions.
Trusted Hosts
Clients must trust non-domain targets.
SSH
Secure Shell - increasingly common in Windows environments.
SSH Tunneling
RDP
Remote Desktop Protocol - graphical remote access.
3389
Standard RDP
Quick Reference Card
Enumeration
Domain info
Get-ADDomain
All users
Get-ADUser -Filter *
All computers
Get-ADComputer -Filter *
All groups
Get-ADGroup -Filter *
Domain Controllers
Get-ADDomainController -Filter *
Trusts
Get-ADTrust -Filter *
SPNs
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName
LDAP query
ldapsearch -x -H ldap://dc -b "dc=domain,dc=com"
Credential Attacks
DCSync
secretsdump.py domain/user:password@dc
Kerberoast
GetUserSPNs.py domain/user:password -request
ASREProast
GetNPUsers.py domain/ -usersfile users.txt -no-pass
Pass the hash
psexec.py -hashes :NTHASH domain/user@target
Golden ticket
ticketer.py -nthash KRBTGT_HASH -domain-sid SID -domain DOMAIN admin
Silver ticket
ticketer.py -nthash SERVICE_HASH -domain-sid SID -domain DOMAIN -spn cifs/target admin
Lateral Movement
PsExec
psexec.py domain/user:password@target
WMIExec
wmiexec.py domain/user:password@target
Evil-WinRM
evil-winrm -i target -u user -p password
RDP
xfreerdp /u:user /p:password /v:target
PowerShell
Enter-PSSession -ComputerName target -Credential domain\user
Common Ports
53
DNS
88
Kerberos
135
RPC Endpoint Mapper
139
NetBIOS Session
389
LDAP
445
SMB
464
Kerberos Password
636
LDAPS
3268
Global Catalog
3269
Global Catalog SSL
3389
RDP
5985
WinRM HTTP
5986
WinRM HTTPS
Tools Summary
Enumeration
BloodHound, PowerView, ADRecon, ldapsearch, rpcclient
Credential Extraction
Mimikatz, pypykatz, secretsdump.py, LaZagne
Kerberos
Rubeus, Impacket (getTGT, getST, GetUserSPNs), kerbrute
Lateral Movement
Impacket suite, CrackMapExec, Evil-WinRM, PsExec
Relay/Poisoning
Responder, ntlmrelayx, Inveigh, mitm6
Privilege Escalation
PowerUp, PrivescCheck, Certify, Certipy
Last updated