Basic AD Pentesting
AD Components
Domain Controller
Server with AD DS server role.
Hosts a copy of the AD DS directory store.
Provides authentication and authorization services.
Replicates updates to other domain controllers.
Allows administrative access to manage resources.
AD DS Data Store
Consists of the Ntds.dit file (password hashes, sensitive information).
Stored in the %SystemRoot%\NTDS folder on all domain controllers.
AD Logical Components
Schema:
Defines objects that can be stored in the directory.
Enforces rules about object creation and configuration.
Domains:
Group and manage objects in an organization.
May include child domains and trusts with other domains.
Trees:
Hierarchy of domains in AD DS.
Can have child domains.
Creates two-way transitive trust with other domains.
Forests:
Collection of Trees.
Shares common schema and configuration.
Enables trusts between domains in the forest.
Shares enterprise admin, schema admins groups.
Organizational Units (OUs):
Containers that can contain users, groups, computers, and other OUs.
Trusts:
Provide mechanisms for users to gain access.
Objects:
Users, contacts, groups, computers, printers, shared folders, etc.
Initial Attack Vectors
Begin with mitm6 or Responder.
Run a scan to generate traffic.
Look for default credentials on web logins.
Target websites in scope (http_version).
Consider printers, Jenkins, etc.
Think outside the box.
Additional Resources:
Enumeration
Kerberos Enumeration
Nmap Scan:
SMB Enumeration:
Replication:
In the
Replication
directory, look forGroups.xml
file.
Extracting cPassword:
Copy the
cPassword
attribute fromGroups.xml
.Use
gpp-decrypt
to decrypt the password:
Psexec.py with Hash:
Kerberoasting with GetUserSPNs.py:
Save the hash to
TGS.txt
.Crack the hash using
john
:
ASREPRoast with GetNPUsers.py:
Save the hash to
TGT.txt
.Crack the hash using
john
:
BloodHound for Full Control:
DC Sync Attack with secretsdump.py:
Golden Ticket with mimikatz:
LMNR
LMNR (Link-Local Multicast Name Resolution) Attack Workflow:
Use
responder
:Wait for events.
Retrieve hashes.
Crack hashes using
hashcat
:
Defense:
Disable LMNR and NBT-NS.
Enforce strong user passwords.
SMB
Identify SMB Signing:
SMB Relay Attack Workflow:
Edit
responder.conf
to turn off SMB and HTTP.Run
responder
:Run
ntlmrelayx.py
:
Gaining a Shell using MSF:
Other Ways to Psexec:
Mitigation:
Enable SMB Signing.
Disable NTLM authentication.
Implement account tiering.
Restrict local admin access.
IPv6 Attacks
Install mitm6:
Setup LDAP for DNS Takeover:
Go to Server Manager.
Add the AD Cert Services feature.
DNS Takeover via mitm6 Workflow:
Delegate Impersonation Attack with ntlnrelayx.py:
Mitigation:
Disable IPv6.
Disable WPAD.
Enable LDAP signing.
Consider administrative users in the protected users group.
Passback Attack
Last updated