Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 38 ยท Post-exploitation and Privilege Escalation

Lateral Movement and Active Directory Concepts

Understand how attackers move between systems in Active Directory networks, how Kerberos and NTLM are abused, and how defenders detect and prevent lateral movement.

Lateral movement is how an attacker goes from the first compromised machine to others, usually heading for the systems that matter: domain controllers, file servers, databases and backups. In most corporate networks the road runs through Active Directory (AD), Microsoft's directory service, which holds users, groups, computers and the rules about who may log on where.

This lesson explains the concepts a penetration tester must understand to test AD safely and to write useful recommendations. It is deliberately defensive: there are no attack commands, but you will learn the logic of the weaknesses and build stand-in detectors that read invented event logs. For a hands-on lab, see the Active Directory lab lesson in the ethical hacking course.

Active Directory in a nutshell

  • A domain is a group of computers and users managed together; a domain controller (DC) answers authentication requests and stores the directory.
  • Users, groups and computers are objects with attributes and permissions. Membership in groups such as Domain Admins grants wide rights.
  • Group Policy pushes settings to machines.
  • Authentication uses Kerberos (tickets) by default and falls back to NTLM (challenge and response) in older or misconfigured situations.
sequenceDiagram
    participant U as User PC
    participant KDC as Domain Controller (KDC)
    participant S as File Server
    U->>KDC: 1. Request a ticket-granting ticket (proves identity)
    KDC-->>U: 2. TGT
    U->>KDC: 3. Present TGT, ask for a service ticket for the file server
    KDC-->>U: 4. Service ticket
    U->>S: 5. Present service ticket
    S-->>U: 6. Access granted

Simplified Kerberos flow. The tickets are what attackers try to steal, forge or request in bulk.

Why lateral movement works

Attackers rarely need new vulnerabilities to spread. They rely on:

  • Credential reuse: the same local administrator password on many machines.
  • Cached credentials: an administrator who once logged on leaves hashes or tickets in memory on that machine.
  • Over-broad rights: service accounts that are domain admins; users with local admin on many hosts.
  • Flat networks: any host can talk to any other on SMB, RDP and remote management ports.
  • Weak legacy protocols: NTLM, unsigned SMB, LLMNR and NetBIOS name-resolution fallbacks that allow relaying or capturing authentication.

The attacker's path

Foothold One workstation
Credentials Found, cached or reused
Move To servers the account can reach
Domain control Admin on the DC

Every step needs a permission or a reused secret.

1 / 2

Key weakness families (concepts only)

Concept What it is Defense
Pass-the-hash / pass-the-ticket Reusing a stolen NTLM hash or Kerberos ticket instead of the password Credential Guard, restrict admin logons, disable NTLM where possible, short ticket lifetimes
Kerberoasting Any user may request service tickets for accounts with service principal names (SPNs); weak service-account passwords can then be cracked offline Long random passwords or group managed service accounts (gMSA); prefer AES encryption; monitor ticket requests
AS-REP roasting Accounts without Kerberos pre-authentication leak crackable data Require pre-authentication on all accounts
NTLM relay / LLMNR poisoning Captured authentication is forwarded to another service Disable LLMNR/NetBIOS, require SMB and LDAP signing, enable channel binding
Delegation abuse Services trusted to act as users can be misused Review delegation settings; protect sensitive accounts
ACL abuse An unexpected "write" permission on a user or group object enables takeover Review AD permissions regularly with a path-analysis tool
Misconfigured certificate services Certificate templates that let low-privileged users obtain admin certificates Audit templates; apply vendor guidance

Testers use graph-based tools such as BloodHound to map these relationships and find the shortest path to Domain Admin. The report value is the path itself ("a help-desk user can reach Domain Admin in four steps") plus the cheapest place to cut it.

Detecting lateral movement

Windows logs authentication events that defenders can correlate. Two useful ones: 4624 (successful logon, with a logon type, where type 3 is a network logon and type 10 a remote desktop logon) and 4769 (a Kerberos service ticket request, which includes the ticket's encryption type).

The first stand-in flags one account logging on to many different hosts in a short time, a pattern typical of an attacker sweeping through machines.

Python Detect one account touching many hosts

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The backup service account touched six machines in two minutes, including the DC, which is exactly the shape worth alerting on. Real rules also consider the account's normal behaviour (a backup tool may legitimately connect to many hosts, so baselines or allow-lists matter).

The second stand-in looks for a Kerberoasting signal: one user account requesting many service tickets with the older RC4 encryption (type 0x17), which is more crackable than AES.

Python Spot a burst of RC4 ticket requests

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A ticket request alone is normal; a burst of the weaker type for many unrelated services from one user is the signal. A honeypot service account that nobody should ever request is an even cleaner trigger.

Testing safely in AD

  • Confirm AD is in scope, including which domains, and ask for a test account and a low-risk time window.
  • Avoid account lockouts, mass changes to objects, or any action that could disrupt authentication. A DC outage stops the entire company.
  • Do not extract or crack hashes of accounts outside your scope, and report any domain admin password you find immediately.
  • Prefer paths and permissions as evidence (a graph screenshot, a group membership list) over actual takeover of privileged accounts.

Defensive priorities

  1. Tiered administration: separate accounts for workstation, server and domain admin tasks; domain admins never log on to workstations.
  2. LAPS for unique local admin passwords.
  3. Segmentation and host firewalls to block workstation-to-workstation SMB/RDP/WinRM.
  4. Disable NTLM and LLMNR; require signing everywhere.
  5. gMSA for services; review SPNs and delegation.
  6. Monitor 4624, 4625, 4768, 4769, 4672 and 7045, forwarded to a SIEM.
  7. Regular AD assessments of permissions and certificate templates.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which situation most directly enables an attacker to spread from one workstation to many?

    A reused local admin password turns one stolen credential into access everywhere.
  2. 2. What is Kerberoasting?

    Any domain user may request tickets for service accounts; weak service-account passwords can then be guessed offline.
  3. 3. What is the best defense against Kerberoasting?

    Long random secrets make offline guessing infeasible; AES is stronger than RC4.
  4. 4. Why should domain admins avoid logging on to ordinary workstations?

    Tiered administration keeps high-value credentials off low-trust machines.

Summary

  • Lateral movement spreads through reused or cached credentials, broad rights and flat networks, usually via Active Directory.
  • Know Kerberos tickets, NTLM, SPNs, delegation and ACLs; graph analysis reveals the shortest path to domain admin.
  • Detect it with correlation: many hosts per account, bursts of RC4 ticket requests, new services and unusual logon types.
  • Test AD carefully to avoid lockouts and outages, and report domain admin credentials at once.
  • Defend with LAPS, tiering, segmentation, signing, gMSA and good monitoring.

Next: Web application testing and the OWASP Top 10