Activedirectory

13 min read2,559 words

ACTIVE DIRECTORY

Active Directory (AD) is extremely important for internal penetration testing, Windows security, red-team operations, and enterprise security.

The goal is not to memorize attacks. You should understand:

How does a Windows domain work, where does it trust users/computers, and where can those trust relationships create an attack path?

Practice only in an authorized AD lab.

What Is Active Directory?

Active Directory Domain Services (AD DS) is Microsoft's directory service for managing identities, computers, permissions, policies, and resources in a Windows domain.

Imagine a company:

COMPANY │ Active Directory │ ┌────────────┼────────────┐ ▼ ▼ ▼ Users Computers Groups │ │ │ └────────────┼────────────┘ ▼ Domain Controller

Instead of every computer having completely independent accounts, the organization can centrally manage them.

The Domain

A domain is a logical security boundary containing objects such as:

Users Computers Groups Servers Policies Service accounts

Example:

corp.local

You might have:

CORP │ ├── Users │ ├── Alice │ ├── Bob │ └── Admin │ ├── Computers │ ├── PC01 │ ├── PC02 │ └── PC03 │ └── Servers ├── DC01 ├── FILE01 └── WEB01

Domain Controller

The Domain Controller (DC) is one of the most important machines in an AD environment.

Conceptually:

DOMAIN CONTROLLER │ ┌────────────┼────────────┐ ▼ ▼ ▼ Users Computers Policies │ ▼ Authentication

It provides important domain services such as:

  • Authentication
  • Directory services
  • Group membership
  • Policy management
  • Kerberos
  • LDAP
  • DNS integration

Compromising a domain controller can have extremely serious consequences in a real enterprise.

Why AD Is Important to Hackers

Imagine you compromise one employee workstation:

Internet ↓ Employee PC ↓ Low-privileged domain user

You're not necessarily finished.

You may discover:

Other users Other computers File servers Service accounts Domain groups Administrative relationships

This creates an attack graph:

Initial User ↓ Computer ↓ Credentials / Permissions ↓ Another Account ↓ Another Computer ↓ Privileged Account ↓ Domain Admin

This is called lateral movement and privilege escalation through an attack path.

AD Components You Must Know

Start with these:

Domain Domain Controller Forest Tree Organizational Unit User Computer Group Group Policy Kerberos LDAP DNS SMB NTLM SPN

Let's understand them.

Forest

A forest is the highest-level AD container.

Conceptually:

Forest │ ├── Domain A │ ├── Domain B │ └── Domain C

A forest can contain multiple domains with trust relationships.

Tree

A tree is a collection of related domains within a forest.

Example:

company.local │ ├── sales.company.local └── dev.company.local

Organizational Unit — OU

An OU is used to organize objects.

Example:

company.local │ ├── HR │ ├── Users │ └── Computers │ ├── IT │ ├── Users │ └── Computers │ └── Finance ├── Users └── Computers

OUs are particularly important because Group Policy can be applied to them.

Users

A domain user might look conceptually like:

CORP\alice

or:

alice@corp.local

A user can have:

Password Groups Permissions SPNs Delegation settings Logon restrictions

Groups

Groups are fundamental to AD authorization.

Example:

Domain Users Domain Admins Administrators Help Desk IT Support Finance

A user can belong to multiple groups:

Alice ├── Domain Users ├── IT Support └── Remote Management Users

This creates privilege relationships.

Group Nesting

Groups can contain other groups.

Example:

Domain Admins ↑ │ IT Admins ↑ │ Alice

Alice's effective privileges may therefore be much greater than they initially appear.

This is why:

Group membership must be analyzed recursively.

Computers Are Objects Too

AD doesn't only contain users.

Computers are represented as directory objects.

Example:

PC01$ PC02$ DC01$ FILE01$

The $ convention often indicates a computer account.

Computers have:

Permissions Groups Credentials Services SPNs Relationships

Kerberos

Kerberos is one of the most important AD authentication protocols.

At a high level:

User ↓ Authentication ↓ KDC ↓ Ticket ↓ Access Service

The Key Distribution Center (KDC) operates as part of the domain controller.

Kerberos uses tickets rather than sending the user's password to every service.

Kerberos Architecture

Conceptually:

DOMAIN CONTROLLER │ KDC ┌────┴────┐ ▼ ▼ AS TGS │ │ └────┬────┘ ▼ Tickets

Two important components:

AS

Authentication Service.

TGS

Ticket Granting Service.

TGT

After authentication, a user can receive a:

Ticket Granting Ticket (TGT).

Conceptually:

Username ↓ Authentication ↓ TGT ↓ Request service ticket

You don't need to memorize the cryptographic details yet.

Understand the flow first.

Service Tickets

Suppose Alice wants to access:

FILE01

Kerberos can issue a service ticket for the appropriate service.

Conceptually:

Alice ↓ TGT ↓ TGS request ↓ Service Ticket ↓ FILE01

This becomes important later when studying Kerberoasting.

LDAP

LDAP is commonly used to interact with directory information.

Conceptually:

Pentester / Application ↓ LDAP ↓ Active Directory ↓ Users / Groups / Computers

LDAP can provide information about:

Users Groups Computers OUs Attributes Relationships

DNS in Active Directory

DNS is extremely important in AD.

A domain controller often also provides or integrates with DNS.

Example:

corp.local

DNS helps systems locate:

Domain Controller Kerberos services LDAP services Other hosts

Therefore:

AD without understanding DNS is incomplete.

SMB

Server Message Block (SMB) is widely used in Windows environments.

Commonly associated with:

445/tcp

SMB can provide:

File shares Printer sharing Remote administration functionality

Examples:

\\FILE01\Public \\FILE01\Finance

From a pentesting perspective, you investigate:

Which shares exist? Who can access them? What files are exposed? Are permissions correct?

NTLM

NTLM is another Windows authentication mechanism.

You'll encounter terms such as:

NTLM NTLMv1 NTLMv2 NTLM hashes Pass-the-Hash

A key principle:

A password hash can sometimes become an authentication credential without recovering the original plaintext password.

This leads to later attacks such as Pass-the-Hash.

Active Directory Enumeration

Once you obtain authorized access to an AD environment, your first objective is:

Understand the environment.

Build an inventory:

Domain │ ├── Domain Controllers ├── Users ├── Groups ├── Computers ├── Servers ├── Shares ├── SPNs ├── Trusts └── Policies

Basic Windows Enumeration

On an authorized Windows lab machine:

whoami
whoami /all
hostname
ipconfig /all
systeminfo

These establish:

Current user Groups Privileges Hostname Network configuration OS information

Domain Information

You may encounter:

echo %USERDOMAIN%

and:

echo %LOGONSERVER%

These can help identify:

Domain Domain Controller

In a lab, you may also use domain-aware Windows commands to enumerate users, groups, and computers.

BloodHound

BloodHound is one of the most important AD security-analysis tools.

Its purpose is not simply:

“Hack Active Directory.”

Its strength is:

Visualizing relationships and identifying attack paths.

Conceptually:

DOMAIN ADMIN ▲ │ Admin Group ▲ │ Server01 ▲ │ User A

BloodHound helps you see relationships like:

User ↓ MemberOf ↓ Group ↓ AdminTo ↓ Computer

Why BloodHound Is Powerful

AD environments can contain thousands of objects.

You might have:

10,000 Users 2,000 Computers 500 Groups

Manually understanding all relationships is difficult.

BloodHound turns that into a graph:

Objects + Relationships ↓ Graph ↓ Attack Paths

SharpHound

SharpHound is commonly used to collect AD relationship data for BloodHound.

Conceptually:

Windows Domain ↓ Data Collection ↓ SharpHound ↓ Collected Relationships ↓ BloodHound ↓ Attack Path Analysis

In an authorized lab, learn what information the collector gathers and why.

Don't blindly run collection tools in production environments because large-scale enumeration can generate logs and network traffic.

Important BloodHound Relationships

You should understand concepts such as:

MemberOf AdminTo HasSession CanRDP CanPSRemote GenericAll GenericWrite WriteDACL WriteOwner ForceChangePassword AddMember

These represent different forms of access or control.

For example:

User A │ └── GenericAll → User B

means User A may have extensive control over User B.

The exact implications depend on the object and environment.

Kerberoasting

One of the famous AD attacks.

First understand the prerequisite:

A domain account may have a Service Principal Name (SPN) associated with it.

Conceptually:

Service Account ↓ SPN ↓ Kerberos Service Ticket ↓ Ticket contains material related to service account ↓ Offline password guessing

The key idea:

Kerberoasting attempts to obtain service tickets for accounts with SPNs and then perform offline password cracking against the relevant ticket material.

This is why weak service-account passwords are dangerous.

Why SPNs Matter

An SPN identifies a service instance.

Conceptually:

HTTP/webserver MSSQL/database CIFS/fileserver

AD uses SPNs to associate services with accounts.

Therefore:

SPN ↓ Service account ↓ Kerberos ticket

becomes an important security relationship.

AS-REP Roasting

Another important Kerberos-related attack.

Some accounts may be configured so that Kerberos pre-authentication is not required.

Conceptually:

User account ↓ Pre-authentication disabled ↓ AS response ↓ Offline password guessing

The defensive lesson:

Accounts should use appropriate Kerberos pre-authentication and strong passwords.

Kerberoasting vs AS-REP Roasting

AttackKey Condition
KerberoastingService account with SPN
AS-REP RoastingPre-authentication disabled

Both can lead to offline password guessing.

Neither attack means:

"Instant Domain Admin"

You still need a viable credential and attack path.

Password Attacks in AD

AD environments may be exposed to:

Password spraying Credential stuffing Offline cracking Kerberoasting AS-REP roasting

Password spraying

Trying one common password across many accounts rather than many passwords against one account.

Conceptually:

Password1 ↓ Alice Bob Charlie David

This can be dangerous in real environments because of account lockouts and monitoring.

Only practice against dedicated lab accounts.

Pass-the-Hash

Suppose you have a valid NTLM credential material.

Instead of recovering the plaintext password:

Password ↓ Hash

some Windows authentication scenarios allow the hash itself to be used to authenticate.

Conceptually:

NTLM hash ↓ Authentication ↓ Access

This is why protecting credential material is critical.

Pass-the-Ticket

Kerberos tickets can also become valuable credentials.

Conceptually:

Valid Kerberos ticket ↓ Use ticket ↓ Authenticate to service

This is a more advanced topic, but the fundamental idea is:

Authentication artifacts can themselves become security-sensitive credentials.

Lateral Movement

Suppose you have:

PC01 ↓ User credentials

and discover:

FILE01

The question becomes:

Can the compromised identity legitimately access another system?

Conceptually:

PC01 │ │ credentials / permissions ▼ FILE01 │ ▼ Server02

This is lateral movement.

It belongs closely with AD because AD centralizes identities and permissions.

Common Windows Remote Access Technologies

You'll encounter:

RDP SMB WinRM PowerShell Remoting

Common ports include:

RDP → 3389 SMB → 445 WinRM → 5985 / 5986

An open port does not mean you can automatically authenticate.

You need:

Valid credentials + Permission + Network access

Group Policy

Group Policy allows administrators to centrally control Windows systems.

Examples:

Password policies Security settings Software configuration Windows Defender settings User restrictions Scripts

Conceptually:

Domain ↓ Group Policy ↓ OU / Computer / User ↓ Configuration

Misconfigured Group Policy can create major security problems.

Delegation

AD delegation determines whether one identity can act on behalf of another in certain contexts.

Important concepts:

Unconstrained delegation Constrained delegation Resource-based constrained delegation

These are advanced AD topics because they involve Kerberos and service authentication.

The key idea:

Incorrect delegation can create unexpected privilege relationships.

Trust Relationships

Domains can trust one another.

Conceptually:

Domain A │ │ Trust ▼ Domain B

Trusts can be legitimate, but incorrect configurations can create unexpected paths between security boundaries.

In large environments, you must map:

Domain ↓ Forest ↓ Trust ↓ Access

Domain Admin

Domain Admins is a highly privileged group.

Conceptually:

Normal User ↓ Compromise ↓ Intermediate Privilege ↓ Domain Admin ↓ Extensive Domain Control

But don't make:

Domain Admin

your only objective.

A professional pentest asks:

What is the maximum business impact I can demonstrate safely?

Sometimes compromising a sensitive server is more relevant than obtaining Domain Admin.

The AD Attack Chain

A realistic authorized-lab attack path might look like:

External Recon ↓ Initial Access ↓ Compromised Workstation ↓ Domain User ↓ AD Enumeration ↓ Find Weak Relationship ↓ Credential / Access ↓ Lateral Movement ↓ Privilege Escalation ↓ High-Privilege Account ↓ Critical Server

Notice that AD attacks are rarely just:

"Run one command → Domain Admin"

They're usually chains of relationships.

AD Enumeration Mindset

After obtaining a domain account, ask:

Who am I? ↓ What groups am I in? ↓ What computers exist? ↓ Who administers those computers? ↓ What users exist? ↓ Which accounts have SPNs? ↓ Which accounts have special privileges? ↓ What sessions exist? ↓ What shares exist? ↓ What trusts exist? ↓ What attack paths exist?

This is the mindset you need.

🧪 Build an AD Lab

For serious AD learning, build something like:

KALI │ ──────┼────── │ LAB NETWORK │ ┌───────────┴───────────┐ │ │ DC01 CLIENT01 │ │ Domain Controller Domain User │ ┌────┴────┐ │ │ USER01 SERVER01

Example:

Domain: corp.local DC: DC01 Client: CLIENT01 Server: SERVER01 Users: alice bob admin

This is far better than trying to learn AD against a real organization.

🧪 Your AD Learning Sequence

Don't jump directly into Kerberoasting.

Follow:

Level 1 — Fundamentals

Domain DC User Computer Group OU Forest Trust

Level 2 — Protocols

DNS LDAP SMB Kerberos NTLM

Level 3 — Enumeration

Users Groups Computers Shares SPNs Sessions Policies Trusts

Level 4 — Attack Paths

Weak permissions Credential exposure Kerberoasting AS-REP roasting ACL abuse Delegation Lateral movement

Level 5 — Graph Analysis

BloodHound SharpHound Attack path analysis

🧠 Most Important AD Mindset

Don't think:

“Which AD attack should I run?”

Think:

DOMAIN ↓ IDENTITY ↓ GROUP MEMBERSHIP ↓ PERMISSIONS ↓ RELATIONSHIPS ↓ TRUST ↓ ACCESS ↓ ATTACK PATH

Active Directory security is fundamentally about identity + permissions + relationships.

If you understand those three things deeply, the individual attacks become much easier to understand.

📌 AD Cheat Sheet

ConceptRemember
DomainLogical AD environment
DCCentral domain services
UserIdentity
ComputerManaged machine/object
GroupCollection of identities
OUOrganizational container
GPOCentral configuration/policy
LDAPDirectory access
KerberosMain domain authentication protocol
NTLMLegacy authentication mechanism
SMBWindows file/network service
SPNIdentifies service instance
TGTKerberos Ticket Granting Ticket
BloodHoundAD relationship/attack-path analysis
KerberoastingService-ticket offline password attack
AS-REP RoastingTargets accounts without Kerberos pre-auth
Pass-the-HashAuthenticate using NTLM credential material
Lateral MovementMove between systems
DelegationService/user impersonation relationships

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy