LESSON 56 · INTERMEDIATE10 min read

Active Directory Attacks in the Lab

Recreate the most common Active Directory attack paths inside an isolated lab, then connect every technique to the telemetry and controls that detect or stop it.

OWASP Top 10 · MITRE ATT&CK · NIST CSF 2.0Free to readModule 11 of 14
YOUR NEXT SMALL WINS

By the end, you’ll be able to…

  • Apply legal and safety boundaries before running any Active Directory offensive tool.
  • Explain how name-resolution poisoning, password spraying, and Kerberos abuse work.
  • Describe credential-reuse attacks including pass-the-hash, overpass-the-hash, and DCSync.
  • Recognise ACL, AD CS, and attack-path techniques used to escalate to domain control.
  • Map each lab technique to defensive telemetry, detection logic, and remediation.

01Rules of Engagement for AD Attack Practice

Active Directory attacks are serious. Unauthorised access to a directory, even with a harmless tool or a single query, is a crime in most countries regardless of intent. Every exercise in this lesson belongs in a lab that you own, on an isolated host-only or internal network, with synthetic users and no connection to a real employer, school, client, or cloud tenant. Write a short rules-of-engagement document before you start: scope, authorisation, dates, tools, data rules, and stop conditions.

A useful lab has one domain controller, one member server, one workstation, and one attacker virtual machine. Use a domain name such as lab.local that cannot resolve on the internet, create fictional users, and snapshot every machine before an experiment. Keep the attacker VM on the same isolated network but give it no bridged adapter and no route to your home LAN. When an exercise is finished, revert the snapshots and record what you observed. The goal is repeatable learning, not a permanent insecure environment.

Adopt a detection-first mindset. Before running a technique, write down the event you expect it to create and the control that should stop it. After running it, look for that event and explain any gap. This habit turns offensive knowledge into defensive value and keeps the work professional. A tester who cannot explain the defensive consequence of a finding is only producing noise.

02Discovery, Name-Resolution Poisoning, and Password Spraying

Discovery starts with questions: what domain is this, who are the privileged users, which computers are domain controllers, which service accounts have SPNs, and what trusts exist? Much of this information is readable by any authenticated domain user, which is why a single low-privilege account is valuable to an attacker. BloodHound later turns those relationships into a graph, but the underlying data comes from ordinary LDAP queries and standard Windows protocols.

LLMNR and NBT-NS are legacy name-resolution protocols. When DNS fails, Windows may broadcast a request for a name, and a tool such as Responder can answer with its own address. If a user or service tries to authenticate to that name, the attacker captures a NetNTLMv2 challenge-response that can be cracked offline or relayed to another service. SMB signing and LDAP signing or channel binding make relay much harder. Disabling LLMNR and NBT-NS where they are not needed removes the opportunity altogether.

Password spraying tries one or a few common passwords across many accounts instead of many passwords against one account. The approach stays under per-account lockout thresholds, so it can be quiet and effective in organisations with weak password habits. Before testing, read the domain lockout policy; in a lab, configure a known threshold and never spray real users. Defences include banned-password lists, multi-factor authentication, smart lockout, unique local administrator passwords, and alerts on failed logons spread across many accounts from one source.

03Kerberoasting and AS-REP Roasting

Kerberoasting abuses the Kerberos service ticket model. Any authenticated domain user can request a ticket for a service principal name, and the resulting service ticket is encrypted with the service account's key. An attacker saves the ticket and tries to crack the service account password offline. No domain admin rights are required, and the request can look like normal application traffic. Weak service account passwords, shared passwords, and RC4 encryption make the attack much easier.

AS-REP roasting targets accounts that have Kerberos pre-authentication disabled. Without pre-authentication, a client can request an authentication service response for the account and receive material encrypted with the user's password-derived key. The attacker cracks it offline in the same way. Pre-authentication should be required for every human account, and any exception needs a documented, reviewed reason. Service accounts should use group managed service accounts or long random secrets.

Both attacks are detectable because the requests are unusual in volume, source, or encryption type. A burst of service ticket requests for many different SPNs from one workstation, or a ticket request using RC4 when the environment normally uses AES, deserves investigation. Domain controllers log 4769 for service ticket requests and 4768 for TGT requests; 4771 records Kerberos pre-authentication failures. Correlate these with the requesting account and device rather than alerting on a single event.

ad-lab-attacks.txtPlain text
# LAB ONLY. Synthetic domain, isolated host-only network, written authorisation.# Replace placeholder values with your own lab addresses and credentials.# 1. Request service tickets for accounts with SPNs (Kerberoasting).GetUserSPNs.py lab.local/student:'LabPassword!' -dc-ip 10.10.10.10 -request -outputfile kerberoast.txt# 2. Request AS-REP material for accounts without pre-authentication.GetNPUsers.py lab.local/ -usersfile lab-users.txt -dc-ip 10.10.10.10 -format hashcat -outputfile asrep.txt# 3. Map users, groups, sessions, and privilege paths.bloodhound-python -u student -p 'LabPassword!' -d lab.local -ns 10.10.10.10 -c All# 4. Dump a single directory hash in the lab (requires replication rights).secretsdump.py lab.local/administrator:'LabPassword!'@10.10.10.10 -just-dc-user krbtgt# Defensive check: find accounts that do not require Kerberos pre-authentication.Get-ADUser -Filter * -Properties DoesNotRequirePreAuth |  Where-Object DoesNotRequirePreAuth -eq $true
Outputstdout
Service tickets requested: 6
Accounts without pre-authentication: 1 (svc-legacy)
BloodHound collection: 412 objects, 38 ACL edges
Directory hash extracted: krbtgt (lab only)

Review: every finding needs an owner, a fix, and a detection.

04Pass-the-Hash, Overpass-the-Hash, and DCSync

Windows stores password verifiers as hashes, and NTLM authentication can accept a hash-derived response without the plaintext password. Pass-the-Hash uses a captured NTLM hash to authenticate as the victim. Overpass-the-Hash uses a hash or key to request a Kerberos ticket, then operates with Kerberos instead of NTLM. Both attacks show why credential theft is so damaging: an attacker does not need to crack a password if the credential material is reusable. Credential Guard, Protected Users, tiered administration, and avoiding NTLM where possible reduce the exposure.

DCSync abuses the directory replication protocol. A principal with replication rights, such as Domain Admins or a service account granted the replication extended rights, can ask a domain controller to send password hashes as if it were another DC. The attacker does not need code execution on the DC. Tools such as secretsdump implement the DRSUAPI calls. The krbtgt hash is especially valuable because it can forge Kerberos tickets. Detect DCSync through 4662 events for the replication GUIDs, unusual directory replication from non-DC hosts, and accounts that suddenly exercise replication rights.

Golden and Silver tickets are forgery techniques. A Golden ticket uses the krbtgt hash to mint a TGT with arbitrary group membership, giving persistence across the domain until the krbtgt password is changed twice. A Silver ticket uses a service account hash to forge a service ticket for a specific service, which can be quieter because it may not touch the DC. SID history and trust configuration can extend the impact. Defenders should protect krbtgt, monitor ticket anomalies, and have a rehearsed krbtgt reset procedure.

05ACL Abuse, AD CS, and Attack-Path Mapping

Active Directory permissions are an attack surface. An ACE such as GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, AddMember, or AllExtendedRights on a user, group, computer, or OU can let a low-privilege principal take over a higher-privilege object. The abuse often requires no exploit, only legitimate directory operations. For example, WriteDACL on a group lets an attacker grant themselves membership, and GenericAll on a computer may allow a resource-based constrained delegation path. Review ACLs on privileged objects, including the AdminSDHolder template.

Active Directory Certificate Services (AD CS) is another identity plane. Certificate templates that let the requester supply a subject and include a client-authentication EKU can be abused to request a certificate for another user, often called ESC1. Other misconfigurations involve enrollment agent templates, insecure template ACLs, or HTTP enrollment endpoints that are vulnerable to relay. A certificate is a credential and can survive a password reset, so AD CS belongs in Tier 0. Audit templates, CA permissions, enrollment endpoints, and the validity and approval settings.

BloodHound and SharpHound collect directory relationships and present them as a graph of users, groups, computers, sessions, and ACL edges. The value is not the picture; it is the path. An analyst can ask how a helpdesk account reaches Domain Admin through nested groups, active sessions, or a writable ACL, then remove the edge that matters. Run collectors only in a lab or an authorised assessment, protect the collected data because it contains sensitive directory information, and validate every purported path manually before reporting it.

Mimikatz is a well-known credential-access toolkit. Its modules illustrate the concepts: extracting logon credentials from LSASS memory, manipulating Kerberos tickets, performing directory replication, and forging tickets. You do not need to run it to understand the defence. LSASS access, suspicious driver loading, and ticket anomalies are detectable, and Credential Guard, attack surface reduction rules, endpoint protection, and least privilege reduce the opportunity. Treat any credential-dumping tool as a lab instrument, not a shortcut to production access.

06Detections That Survive the Noise

Good detections combine identity, endpoint, and network evidence. A Kerberoasting alert might use 4769 with RC4 encryption from a workstation that rarely requests service tickets. A DCSync alert might use 4662 with replication rights from a non-DC source. A password spray alert might use many 4625 failures across different accounts from one address, followed by a success. A Golden ticket alert might use a TGT with an unusual lifetime or a service ticket request without a preceding TGT request. Each rule needs a baseline and a runbook.

Honeytokens add high-confidence signal. Create a decoy user account with an attractive name that has no business function, a decoy SPN, or a fake privileged group. Any authentication or ticket request for the decoy is suspicious by design. Place canary files on file shares and alert on access. Honeytokens are not a replacement for real controls, but they catch attackers who enumerate everything and cannot distinguish a trap from a target.

Finally, keep the offensive work proportional and lawful. The purpose of learning these techniques is to recognise the path, close it, and detect it. Do not publish lab credentials, do not retain real hashes, and do not reuse a technique outside an authorised engagement. A mature security professional can explain both how an attack works and why the organisation is now harder to attack because of the finding.

LET IT CLICK

The ideas worth keeping.

  • Offensive AD work is only legitimate inside an isolated lab with explicit authorisation and synthetic data.
  • Kerberoasting and AS-REP roasting turn weak service-account credentials into offline cracking opportunities.
  • Pass-the-hash, DCSync, and ticket forgery show why Tier 0 credential isolation and krbtgt protection matter.
  • Every technique should be paired with a detection hypothesis, a runbook, and a verified remediation.
TURN UNDERSTANDING INTO SOMETHING YOU CAN DO

Make it yours.

Type and test your code right here in the interactive workspace. Run your solution, check the output, and compare with the worked guide when ready.

01

Exercise 1: Kerberoast a lab service account

In your isolated lab, identify an account with an SPN, request a service ticket with GetUserSPNs.py, and explain how you would determine whether the account is vulnerable. Then write the detection and the remediation you would recommend.

Explore a worked solution
one_possible_solution.mdCybersecurity
Run setspn -T lab.local -Q */* or Get-ADUser -Filter { ServicePrincipalName -like '*' } -Properties ServicePrincipalName to find SPN-bearing accounts. From the attacker VM, run GetUserSPNs.py lab.local/student:'LabPassword!' -dc-ip 10.10.10.10 -request -outputfile kerberoast.txt. Inspect the ticket encryption type; RC4 (etype 23) is weaker and easier to crack than AES. Attempt an offline crack only against the lab hash with a wordlist you control. Detection: alert on 4769 with RC4 for accounts that normally use AES, especially bursts from one workstation. Remediation: move the service to a gMSA or set a long random password, remove unnecessary SPNs, require AES, and review the account's privileges.

Kerberoasting succeeds because service tickets are available to any authenticated user and are encrypted with the service account key. The defence is strong credential material plus monitoring for abnormal ticket requests.

02

Exercise 2: Triage a password spray alert

Your SIEM reports 4625 failures for 30 different accounts from one internal address within five minutes, followed by one 4624 success. The source is a workstation in the finance VLAN. Outline your triage, containment, and follow-up.

Explore a worked solution
one_possible_solution.mdCybersecurity
Validate the alert: confirm the source host, the account names, the logon types, and whether the failures are interactive, network, or service logons. Check whether the success is a normal user logon or a new session on a server. Contact the user and the workstation owner out of band. If the activity is not explained, isolate the workstation, disable or reset the successful account, revoke its sessions and tokens, and review what the account accessed. Search for the same source address or user agent across other systems, check for new accounts, group changes, and scheduled tasks, and preserve logs before cleanup. Follow up with a password reset for affected users, MFA enforcement, and a review of the lockout and alerting thresholds.

A spray often produces failures across many accounts, not a burst against one. The single success is the important event because it may mark the transition from guessing to access.

A SMALL QUESTION. A USEFUL NEXT STEP.

What stayed with you?

Check the ideas while they’re fresh. Your answers stay in this page and feedback appears as you go.

A LITTLE ACTIVE RECALL0 / 3 answered
01Which attack lets any authenticated user request service tickets for offline cracking?
02What configuration makes AS-REP roasting possible?
03What does a DCSync attack abuse?

Keep exploring.

The official references behind this lesson, when you want a second angle or the full details.

One lesson closer.

Reading is a start. Trying it yourself makes the connection.

Completion is saved in this browser. It records reading and hands-on practice progress.