Skip to content
Write-up Intermediate

I Didn’t Stop at Domain Admin

The author built a deliberately vulnerable Active Directory lab and compromised it end to end, then hardened it and re-audited with two scanners. The report describes the attack chain and the hardening process, including a case where a registry-only fix was silently reverted by Group Policy.

Zakariyaelmansouri Follow

Published on medium.com

Search “Active Directory kill chain” and you’ll find a thousand posts that stop on the same screenshot:

Zakariyaelmansouri, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context: what the target, product and feature are, and what the feature normally does

This is not a bug bounty report against a live third-party product. It is a purple team write-up about a deliberately vulnerable Active Directory lab: a single Domain Controller running Windows Server 2022 on KVM/libvirt, in the domain [redacted], built from WazeHell's vulnerable-AD. The attacker box is Kali on the same isolated network.

The feature under examination is Active Directory itself: Kerberos pre-authentication, group nesting and ACLs, replication rights, password policy, LDAP signing and NTLM/LM authentication levels. The author's point is that most AD write-ups stop at Domain Admin, and that the interesting work is proving that hardening actually reduced risk. The compromise is only how the holes were found.

Setup: accounts, roles, tools, versions and preconditions

  • Domain: [redacted], one Domain Controller (Windows Server 2022) on KVM/libvirt.
  • Attacker: Kali, same isolated network.
  • Starting position: assume-breach with no account at all. First access had to be earned.
  • Discipline: strict black box. The author did not use knowledge of how the lab was generated: not the account names the generator produces, not its internal wordlist. Logins came from enumeration and passwords from public wordlists (rockyou, SecLists). If an external attacker could not find it, it was not used.

Tools used across the engagement:

  • Impacket (GetNPUsers, secretsdump), hashcat, NetExec (nxc).
  • BloodHound, plus a small offline analyser the author wrote, adpath.
  • PingCastle: risk score per category, 0 best and 100 worst.
  • Purple Knight (Semperis): Indicators of Exposure, graded like a report card.
  • DSInternals: real password quality pulled from replication data.
  • Native PowerShell baseline.

All credentials and hashes are redacted in the write-up and none of it is replayable against anyone else.

Finding it: what the researcher noticed and why it looked wrong

The full chain, from nothing to Domain Admin, as the author lays it out:

Text
Anonymous LDAP enum → AS-REP roasting → BloodHound attack-path analysis  → ACL abuse (GenericAll → password reset → group nesting)  → Kerberoasting → DCSync → NTDS.dit dump → Pass-the-Hash → Domain Admin

Three observations drove the work:

  1. A handful of accounts had Kerberos pre-authentication disabled (DONT_REQ_PREAUTH), which allows requesting crackable ciphertext for a user whose password you do not have.
  2. The path that mattered was not a vulnerability but a chain of mundane rights: group nesting plus one over-broad GenericAll.
  3. The account holding replication rights, the one that unlocks DCSync, used a default-style password that public wordlists miss but a defaults/corporate list catches immediately.

Exploitation: step by step

Step 1: Foothold without a password (AS-REP roasting)

With no credentials, the author enumerated anonymously over LDAP, then requested AS-REP hashes for accounts with pre-authentication disabled:

Bash
impacket-GetNPUsers [redacted]/ -usersfile users.txt -dc-ip $DC -no-pass -format hashcat -outputfile asrep.txt
hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt

-no-pass requests the AS-REP without credentials, -format hashcat writes the hashes in hashcat's format, and -m 18200 is hashcat's mode for Kerberos 5 AS-REP etype 23. Three accounts fell to rockyou, giving the first credentials.

Step 2: Reading the domain as a graph

With one account, the author ran BloodHound and the offline analyser, and stopped reading the domain as a list of users. The path that mattered was a composition of ordinary rights rather than a CVE:

Text
user → MemberOf → EXECUTIVES → GenericAll → victim     → MemberOf → ACCOUNTING → GenericAll → PROJECT MANAGEMENT → MemberOf → DnsAdmins

Group nesting plus one over-broad GenericAll walks straight to the DC. The chain includes ACL abuse: GenericAll, a password reset and group nesting.

Step 3: The password lesson

The account that actually held the replication rights used a default like Changeme123!. Uppercase, digits and a symbol mean it sails past rockyou and falls instantly to a defaults/corporate list. The author's conclusion: match the wordlist to the target instead of reaching for rockyou and declaring the password strong.

Step 4: DCSync, NTDS.dit and Pass-the-Hash

From the replication rights, DCSync is routine: secretsdump -just-dc for the whole NTDS.dit, then Pass-the-Hash as Administrator. The red side proved the holes were real.

Step 5: Freezing a baseline before touching anything

Before any fix, the author froze a baseline with three tools that look at AD from different angles: PingCastle, Purple Knight and DSInternals. Fourteen findings came out, each written up as weakness → risk → recommendation → control and mapped to NIST CSF 2.0 and MITRE ATT&CK.

Two of the fourteen were never seen by the attack and were found only by the scanners: a remotely reachable Print Spooler on the DC (PrinterBug and PrintNightmare) and LDAP signing not being required. Offence and defence are blind in different places.

Step 6: Hardening in waves

  • Wave 1, quick wins: re-enable Kerberos pre-auth, purge cleartext passwords sitting in account description fields, reset default and weak accounts.
  • Wave 2, policy: minimum length 4 → 14, complexity on, account lockout 0 → 10.
  • Wave 3, rights: strip DCSync rights from non-DC accounts, empty DnsAdmins, move service accounts toward gMSA, put Administrator in Protected Users and mark it non-delegable.
  • Wave 3b, transport: disable the DC Spooler, require LDAP signing, kill NTLMv1 and LM.

Step 7: The fix that was silently reverted

The author set the registry keys for NTLMv1/LM and LDAP signing on the DC and verified locally. PingCastle kept flagging S-OldNtlm on the re-scan. The registry was not wrong; it was being overwritten. The lab, like many real environments, seeds insecure values through the Default Domain Controllers Policy GPO, the GptTmpl.inf file in SYSVOL, and Group Policy stamps the insecure value back over the local edit at the next refresh. PingCastle's rule help states that if no GPO defines the LAN Manager authentication level, the DC falls back to the insecure default.

The real fix was editing the GPO's GptTmpl.inf directly, bumping the GPO version number, and running:

Text
gpupdate /force

On any environment that manages security through GPO, a registry-only change can look applied locally while being silently reverted at the policy level.

Step 8: Re-measuring

After the waves and one residual cleanup pass, the same baseline runbook was replayed:

Tool Before After
Native PowerShell baseline + DSInternals not stated 100% clean, zero dictionary passwords
PingCastle 70/100 35/100 (Privileged Accounts 50 → 0)
Purple Knight 79% (C−), 3 critical IOEs 97% (B+), 0 critical IOEs, IOEs 18 → 8

The remaining PingCastle 35 is capped by Anomalies inherent to a single-DC lab, such as no AD backup policy and no second DC for redundancy. Two of the eight remaining Purple Knight IOEs are artifacts of the hardening itself: recent GPO and group changes flagged as recent changes, not regressions.

One risk was knowingly accepted: non-privileged principals being able to self-set an SPN or UPN. That is default AD schema behaviour since Server 2003, and removing it means editing the schema defaultSecurityDescriptor forest-wide, which risks breaking real services.

Root cause: the mistake in the code or design, and why existing defences did not stop it

The weaknesses are configuration and design, not code defects:

  • Kerberos pre-authentication disabled on several accounts, allowing offline cracking of AS-REP hashes.
  • Over-broad GenericAll ACLs combined with group nesting, giving a path to the DC without any CVE.
  • Replication rights (DCSync) held by a non-DC account protected by a default-style password.
  • Cleartext passwords in account description fields.
  • Weak password policy (minimum length 4, lockout 0).
  • A remotely reachable Print Spooler on the DC and LDAP signing not required.
  • NTLMv1/LM and LDAP signing values seeded through the Default Domain Controllers Policy GPO, so local registry edits are reverted at policy refresh.

Existing defences did not stop the chain because the rights were legitimate AD features composed together, and because the hardening was initially applied at the wrong layer (registry rather than GPO).

Impact: what an attacker could do, to whom, under which conditions

An external attacker starting with no account could enumerate anonymously, roast AS-REP hashes, crack three accounts with rockyou, walk ACLs and group nesting to the DC, Kerberoast, DCSync the whole NTDS.dit, and Pass-the-Hash as Administrator to reach Domain Admin. The conditions are the lab's own: a single DC with the misconfigurations above, reachable on the same network. The author notes that the account holding replication rights used a default-style password.

Fix: what was changed

The author changed the following, in waves: re-enabled Kerberos pre-auth; purged cleartext passwords from description fields; reset default and weak accounts; raised minimum length from 4 to 14; enabled complexity; set lockout from 0 to 10; stripped DCSync rights from non-DC accounts; emptied DnsAdmins; moved service accounts toward gMSA; put Administrator in Protected Users and marked it non-delegable; disabled the DC Spooler; required LDAP signing; killed NTLMv1 and LM. The real fix was editing the GPO's GptTmpl.inf directly, bumping the GPO version number and running gpupdate /force. The SPN/UPN self-set risk was documented as accepted rather than fixed.

Variants to test: concrete things to try on other targets

  1. AS-REP roasting with a targeted wordlist. Run impacket-GetNPUsers with -no-pass against enumerated accounts, then crack with a defaults/corporate list as well as rockyou. Positive result: a hash that cracks to a valid credential.
  2. BloodHound path composition. Collect with BloodHound and look for GenericAll, GenericWrite or MemberOf chains that reach privileged groups. Positive result: a path from an owned account to Domain Admins or DnsAdmins without a CVE.
  3. DCSync rights audit. Check which non-DC accounts hold replication rights and test their passwords against default-style lists. Positive result: secretsdump -just-dc returns NTDS.dit contents.
  4. GPO vs registry drift. After setting a security value locally, re-scan with a second tool such as PingCastle. Positive result: the value is flagged again after a policy refresh, showing the GPO is overwriting it.
  5. Spooler and LDAP signing checks. Test whether the DC Spooler is remotely reachable and whether LDAP signing is required. Positive result: PrinterBug/PrintNightmare exposure or an unsigned LDAP bind accepted.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 25 min read.

What happened, in plain words

Imagine you own a small office building and you want to know how easy it would be for a burglar to get in. You could hire someone to break in, and they would succeed, because you left a window open. That feels like a result, but it is not the useful part. The useful part is: you close the window, and then you prove, with a checklist and a second opinion, that the window is really closed and that nothing else was left open.

This write-up is that story, but for a computer network instead of a building. The author built a small, deliberately insecure network in an isolated lab, broke into it completely, then hardened it and measured the result with independent scanning tools. The PingCastle score went down and the Purple Knight score went up, both meaning less risk.

The network in question is an Active Directory lab. Active Directory (AD) is Microsoft's system for managing users, computers and permissions inside an organisation. Think of it as the office's key cabinet plus the receptionist's list of who is allowed into which room. A Domain Controller (DC) is the one server that holds that list and answers questions like "is this password correct?" and "is this person allowed to read that file?". Almost every company that runs Windows uses AD, which is why it is such a popular target.

The author's point is simple and worth repeating: most write-ups about AD stop the moment the attacker becomes Domain Admin, the all-powerful account that controls the whole domain. That is the easy half. The hard half, and the one this article is about, is proving that the fixes actually worked.

Why this one is different

If you search the web for "Active Directory kill chain" (a kill chain is the sequence of steps an attacker takes from first contact to full control), you will find a thousand posts that stop on the same screenshot:

Text
nxc smb DC -u administrator -H <hash>   (Pwn3d!)

This is a command line. Let us take it apart, because every piece is a concept you will meet again.

  • nxc is the short name of NetExec, a tool that talks to Windows machines over the network. Think of it as a universal remote control for Windows services.
  • smb is the protocol it uses. SMB (Server Message Block) is the language Windows machines speak to share files and to authenticate users. It is like the intercom at the office door.
  • DC is a placeholder for the address of the Domain Controller.
  • -u administrator says "log in as the user called administrator".
  • -H <hash> says "use this password hash instead of a password". A hash is a fingerprint of a password: a fixed-length string of characters produced by a mathematical function. You cannot read the password back from it, but if you have the hash, Windows will often accept it directly as proof of identity. This trick is called Pass-the-Hash, and it is why stealing hashes is as good as stealing passwords.
  • (Pwn3d!) is NetExec's cheerful way of saying "this login worked and the account is an administrator on that machine".

So the screenshot means: "I logged into the Domain Controller as administrator using a stolen hash, and I now own it." The author's reaction is: you won, fine. But "can you get Domain Admin?" was never the interesting question. These labs are built to fall, and everyone gets there. The question a purple teamer actually has to answer is harder. A purple team is a security team that does both attack (red) and defence (blue) work and tries to learn from both. The question is:

You found 14 holes. You closed them. Can you prove the domain is safer now?

So the author built a deliberately vulnerable single-DC domain, compromised it end to end in black box mode (meaning: with no inside knowledge, like an outsider would), hardened it against two well-known sets of security recommendations, and re-audited it with two independent scanners. The two recommendation sets are the ANSSI Active Directory guides (ANSSI is the French national cybersecurity agency, and its guides are a checklist of how to configure AD safely) and the CIS Benchmarks (a similar, widely used set of hardening checklists).

Here is the before and after:

  • PingCastle: 70/100 → 35/100 (lower is better)
  • Purple Knight: 79% (C−), 3 critical IOEs → 97% (B+), 0 critical IOEs (higher is better)

PingCastle is a free tool that scans an AD domain and gives it a risk score from 0 to 100, where 0 is best and 100 is worst. Purple Knight is a similar free tool from a company called Semperis; it grades the domain like a school report card and lists IOEs, which stands for Indicators of Exposure: specific, named weaknesses such as "this account can do too much" or "this setting is insecure". A critical IOE is one that, on its own, is enough to let an attacker do serious damage.

The risk score halved, and every critical Indicator of Exposure is gone. That delta (the difference between before and after) is the entire point of the project. The compromise was just how the author found the holes.

A note on scope and ethics. Everything below happened on a strictly personal, isolated lab the author owns, built from WazeHell's vulnerable-AD. That is a public project that builds a deliberately broken AD lab for practice. Every credential and hash is redacted, and none of it is replayable against anyone else. Attack only what you are authorised to attack. This is not a legal nicety; breaking into a system you do not own is a crime in most countries, even if you mean well.

The lab

  • Domain: [redacted], a single Domain Controller (Windows Server 2022) on KVM/libvirt.
  • Attacker: Kali, on the same isolated network.
  • Starting position: a realistic assume-breach with no account to begin with. First access was earned, not handed over.
  • Discipline: strict black box. The author never used what they knew about how the lab was built: the account names its generator spits out, its internal wordlist. Logins came from enumeration, passwords from public wordlists (rockyou, SecLists). If an external attacker could not find it, it was not used.

Let us unpack the terms.

  • A domain is a named group of computers and users that share one set of rules and one central login. [redacted] is the name of this one. The .local ending is a convention for internal, non-internet names.
  • Windows Server 2022 is the version of the operating system running on the Domain Controller.
  • KVM/libvirt is free software that lets you run a whole computer inside a window on your own computer. It is called a virtual machine (VM). It is like having a second, disposable computer on your desk that you can break without consequences.
  • Kali is a Linux distribution (an operating system) that comes pre-loaded with security tools. It is the standard attacker's toolkit.
  • Isolated network means the lab machines can talk to each other but not to the internet or to anything else. It is a sealed room.
  • Assume-breach is a mindset: instead of asking "how do we keep attackers out?", you assume they are already inside and ask "what can they do next?". Starting with no account at all makes the exercise harder and more realistic.
  • Enumeration is the process of asking a system questions to learn what is in it: which users exist, which groups, which computers. It is like walking around a building reading the nameplates on doors.
  • rockyou and SecLists are famous, publicly available lists of passwords and usernames that have leaked over the years. Attackers use them to guess passwords. A wordlist is just a text file with one candidate per line.

That last rule, strict black box, is the whole difference between running the answer key and doing the work. If you peek at how the lab was built, you are not testing whether an outsider could get in; you are testing whether you can read instructions.

The red side: one weak link at a time

"Red side" means the attacking half of the exercise. The full chain, from nothing to Domain Admin, is:

Text
Anonymous LDAP enum → AS-REP roasting → BloodHound attack-path analysis  → ACL abuse (GenericAll → password reset → group nesting)  → Kerberoasting → DCSync → NTDS.dit dump → Pass-the-Hash → Domain Admin

This is a chain of arrows, each one a step. Let us walk it, because every term here is a concept worth knowing.

  • Anonymous LDAP enum. LDAP (Lightweight Directory Access Protocol) is the language used to query AD: "list all users", "show me this group's members". Anonymous means doing it without logging in at all. Many AD setups allow anonymous queries by default, which is like leaving the office directory on the reception desk for anyone to read.
  • AS-REP roasting. Kerberos is the authentication system AD uses. When you log in, Kerberos hands out a ticket, much like a cinema ticket that proves you paid. Normally, before giving you a ticket, the server asks you to prove you know your password (this is called pre-authentication). If pre-authentication is turned off for an account, the server hands out an encrypted blob (the AS-REP) to anyone who asks, without any proof. That blob is encrypted with the user's password, so an attacker can take it home and guess passwords offline, at full speed, without the server noticing. That is AS-REP roasting.
  • BloodHound attack-path analysis. BloodHound is a free tool that draws a map of who can do what to whom in AD. It turns a boring list of users into a graph, like a subway map, where you can see the route from where you are to where you want to be.
  • ACL abuse. An ACL (Access Control List) is the list of permissions attached to an object: who may read it, who may change it, who may reset its password. Abusing an ACL means using a permission that was granted too generously.
  • GenericAll is a specific AD permission meaning "full control": read, write, change password, delete. If you have GenericAll on a user, you can reset that user's password and then log in as them.
  • Group nesting means putting one group inside another. If group A is a member of group B, everyone in A is effectively in B. Nesting is normal and useful, but it can quietly give people far more power than intended.
  • Kerberoasting. Some accounts have a Service Principal Name (SPN), which marks them as running a service (a database, a web app). Kerberos will hand out a ticket for that service, encrypted with the service account's password, to any authenticated user. Kerberoasting is requesting those tickets and cracking them offline, just like AS-REP roasting but for service accounts.
  • DCSync. The Domain Controller replicates (copies) its data to other Domain Controllers using a special protocol. DCSync is an attack that pretends to be a Domain Controller and asks a real one to send over the password data. It requires a specific permission called "Replicating Directory Changes", which should only ever be held by Domain Controllers.
  • NTDS.dit dump. NTDS.dit is the actual database file on the Domain Controller that stores every user, computer and password hash in the domain. Dumping it means copying it out. It is the crown jewels.
  • Pass-the-Hash. As explained above: using a stolen hash directly as a login, without ever knowing the plain password.
  • Domain Admin. The group with ultimate power over the domain.

A few moments worth calling out.

Foothold without a password

A handful of accounts had Kerberos pre-authentication disabled (DONT_REQ_PREAUTH), which lets you request crackable ciphertext for a user whose password you do not have:

Bash
impacket-GetNPUsers [redacted]/ -usersfile users.txt -dc-ip $DC -no-pass -format hashcat -outputfile asrep.txt
hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt

Line by line:

  • impacket-GetNPUsers is a tool from Impacket, a well-known collection of Python scripts for talking to Windows networks. This particular one asks the Domain Controller for AS-REP blobs for users who do not require pre-authentication.
  • [redacted]/ is the domain name, with a trailing slash and nothing after it, meaning "no username".
  • -usersfile users.txt points to a text file containing the list of usernames to try.
  • -dc-ip $DC tells the tool the address of the Domain Controller. $DC is a shell variable holding that address.
  • -no-pass means "do not send a password", which is the whole point: we have none.
  • -format hashcat writes the output in the exact format that the cracking tool hashcat expects.
  • -outputfile asrep.txt saves the results to a file called asrep.txt.

The second line:

  • hashcat is the world's most popular password-cracking tool. It takes a hash and tries billions of candidate passwords against it, very fast, using the graphics card.
  • -m 18200 is hashcat's internal number for the type of hash we have (Kerberos 5 AS-REP, encryption type 23). Each hash type has its own number; using the wrong one just wastes time.
  • asrep.txt is the file we just produced.
  • /usr/share/wordlists/rockyou.txt is the path to the rockyou wordlist on Kali.

Three accounts fell to rockyou. First credentials, earned cleanly. "Fell" means their passwords were among the guesses in the list.

Thinking in a graph, not a checklist

With one account, the author ran BloodHound (plus a small offline analyser they wrote, adpath) and stopped reading the domain as a list of users. They started reading it as a graph of who can act on whom. The path that mattered was not a vulnerability; it was a chain of mundane rights:

Text
user → MemberOf → EXECUTIVES → GenericAll → victim     → MemberOf → ACCOUNTING → GenericAll → PROJECT MANAGEMENT → MemberOf → DnsAdmins

Read this left to right. A user is a MemberOf the group EXECUTIVES. The EXECUTIVES group has GenericAll (full control) over an account called victim. That victim account is a MemberOf the group ACCOUNTING. ACCOUNTING has GenericAll over the group PROJECT MANAGEMENT. PROJECT MANAGEMENT is a MemberOf the group DnsAdmins.

Why does DnsAdmins matter? DnsAdmins is a group that manages the DNS service (the service that turns names like [redacted] into network addresses). So this chain, made entirely of ordinary, legitimate permissions, walks you straight to the DC.

None of those edges is a CVE. A CVE is a publicly catalogued software bug with an ID number, like a recall notice for a faulty product. The point here is that no software was buggy. It is the composition, group nesting plus one over-broad GenericAll, that does the damage. Each individual permission looks harmless; together they are a road.

The lesson that cost the most time: "weak" is not a synonym for "in rockyou"

The account that actually held the replication rights, the one that unlocks DCSync and the keys to the kingdom, used a default like Changeme123!. Uppercase, digits, a symbol: it sails straight past rockyou, and falls instantly to a defaults/corporate list. A defaults/corporate list is a wordlist built from passwords that vendors ship by default and that companies commonly choose, like Changeme123!, CompanyName2024!, Welcome1!. Match the wordlist to the target instead of reaching for rockyou and declaring the password strong. A password can be complex and still be terrible, if it is a password everyone else also uses.

From DCSync it is routine: secretsdump -just-dc for the whole NTDS.dit, then Pass-the-Hash as Administrator, and the domain is yours. secretsdump is another Impacket tool; -just-dc tells it to grab only the domain credential data, which is the part you want. The red side proved the holes were real. Then the actual work started.

The pivot: why the author did not stop

Getting Domain Admin told the author that the domain was broken. It did not tell them how broken, in a way anyone else could verify. So before touching anything, they froze a baseline with three tools that look at AD from different angles. A baseline is a snapshot of the current state, taken before changes, so you can compare later. It is like weighing yourself on day one of a diet.

  • PingCastle: a risk score per category (0 best, 100 worst).
  • Purple Knight (Semperis): detailed Indicators of Exposure, graded like a report card.
  • DSInternals: real password quality, pulled straight from replication data. DSInternals is a PowerShell module (a set of commands for Windows) that reads AD's internal data directly, so it can tell you how many accounts use dictionary passwords, not just what the policy says.

Running all three is what makes a before/after defensible instead of a vibe. Fourteen findings came out of it, each written up as weakness → risk → recommendation → control, and mapped to NIST CSF 2.0 and MITRE ATT&CK. Those two are standard frameworks: NIST CSF is a US government framework for organising security work into categories, and MITRE ATT&CK is a catalogue of real attacker techniques, each with an ID, so you can say "this weakness enables technique T1003". Mapping findings to them is how you talk to management and to other security teams in a shared language.

Two of the fourteen, the attack never showed the author; the scanners did: a remotely reachable Print Spooler on the DC (hello PrinterBug and PrintNightmare) and LDAP signing not being required. The Print Spooler is the Windows service that handles printing; it has had serious bugs that let an attacker take over a machine just by asking it to print. LDAP signing is a setting that makes LDAP clients prove who they are cryptographically; without it, an attacker on the network can tamper with LDAP traffic. Offence and defence are blind in different places. You want both.

The blue side: fix in waves, then re-measure

"Blue side" means the defending half. The author did not fix at random. They worked in waves, cheapest and highest-impact first. This is deliberate: if you change everything at once and the score improves, you do not know which change mattered.

  • Wave 1, quick wins: re-enable Kerberos pre-auth, purge cleartext passwords sitting in account description fields (yes, really), reset default and weak accounts. The description field is a free-text box on every AD account, often used for job titles; people sometimes put passwords there, which is like taping your house key to the front door with a label.
  • Wave 2, policy: minimum length 4 → 14, complexity on, account lockout 0 → 10. Account lockout means: after this many wrong passwords, lock the account for a while. Zero means never lock, so an attacker can guess forever.
  • Wave 3, rights: strip DCSync rights from non-DC accounts, empty DnsAdmins, move service accounts toward gMSA, put Administrator in Protected Users and mark it non-delegable. A service account is an account used by software rather than a person. A gMSA (group Managed Service Account) is a special kind of service account whose password Windows manages automatically and rotates, so nobody has to choose or remember it. Protected Users is a built-in AD group that applies extra protections to its members, such as refusing weaker authentication methods. Non-delegable means the account cannot be used to impersonate a user to another service, which closes a common lateral-movement trick.
  • Wave 3b, transport: disable the DC Spooler, require LDAP signing, kill NTLMv1 and LM. NTLM and LM are older Windows authentication protocols; NTLMv1 and LM are the oldest and weakest versions, and they should be turned off because their hashes can be cracked almost instantly.

Then the author replayed the exact same baseline runbook and watched the counters drop. A runbook is a written, repeatable procedure: the same steps, in the same order, so the comparison is fair.

The war story: when the fix is a lie your scanner catches

This is the part the author would actually tell a junior, because it is the kind of thing you only learn by getting burned.

The author "fixed" NTLMv1/LM and LDAP signing the obvious way: set the registry keys on the DC, verified locally, done. The registry is Windows' central settings database, a big tree of named values. Setting a registry key is like changing a setting in the control panel.

Except PingCastle kept flagging S-OldNtlm on the re-scan. S-OldNtlm is the name of a specific PingCastle finding meaning "old NTLM is still allowed".

The registry was not wrong. It was being overwritten. This lab, like plenty of real environments, seeds its insecure values through the Default Domain Controllers Policy GPO, the GptTmpl.inf file in SYSVOL, and Group Policy cheerfully stamps the insecure value back over the local edit at the next refresh.

Let us unpack that, because it is the single most useful lesson in the article.

  • Group Policy (GPO) is AD's central settings system. An administrator defines a setting once, in a policy object, and every machine in scope receives it automatically. It is like a company-wide memo that overrides whatever you wrote on your own whiteboard.
  • The Default Domain Controllers Policy is the built-in GPO that applies to Domain Controllers.
  • SYSVOL is a shared folder that every Domain Controller replicates, where GPO files live. GptTmpl.inf is a plain text file inside a GPO that holds security settings, including the LAN Manager authentication level (which controls whether NTLMv1 is allowed).
  • Refresh means the periodic moment when a machine re-reads its GPOs and applies them. At that moment, the GPO's value wins over the local registry edit.

PingCastle's own rule help even spells it out: if no GPO defines the LAN Manager authentication level, the DC falls back to the insecure default.

The real fix was editing the GPO's GptTmpl.inf directly, bumping the GPO version number, and running:

Text
gpupdate /force

gpupdate is the Windows command that makes a machine re-read its Group Policy immediately instead of waiting for the next scheduled refresh. /force means "re-apply everything, even settings that look unchanged".

The lesson: on any environment that manages security through GPO, a registry-only change can look applied locally while being silently reverted at the policy level. A second scanner is what caught the author's own mistake, which is the whole value of measuring instead of assuming.

The numbers that moved

After the waves and one residual cleanup pass:

  • Native PowerShell baseline + DSInternals: 100% clean. Every counter at target, zero dictionary passwords. PowerShell is Windows' built-in scripting language; a "native PowerShell baseline" means a script written with built-in commands that checks each setting against the target value.
  • PingCastle: 70 → 35/100, with Privileged Accounts going 50 → 0. The remaining 35 is capped by "Anomalies" inherent to a single-DC lab, like no AD backup policy and no second DC for redundancy, which are not quick-fixable and are honestly out of scope for a lab.
  • Purple Knight: 79% (C−) → 97% (B+). IOEs 18 → 8, critical 3 → 0. Two of the eight that remain are artifacts of the hardening itself: recent GPO and group changes flagged as recent changes, not regressions. In other words, the tool noticed that things had changed recently, which is exactly what you would expect after a hardening pass.

The author kept one risk knowingly accepted rather than fixed: non-privileged principals being able to self-set an SPN or UPN. An SPN we met above; a UPN (User Principal Name) is the login name in email format, like [redacted]. That is default AD schema behaviour since Server 2003, and removing it means editing the schema defaultSecurityDescriptor forest-wide, which risks breaking real services. The schema is the blueprint that defines what objects and permissions AD can hold; defaultSecurityDescriptor is the default permission list applied to new objects. Changing it forest-wide (across the whole AD forest, the top-level container of domains) is a big, risky operation. On a lab, that trade-off between security and stability is not worth it, so the author documented it and moved on. Writing down what you chose not to fix, and why, is a GRC skill in its own right. GRC stands for Governance, Risk and Compliance: the paperwork side of security, which sounds dull but is how organisations decide what to accept.

Two small tools built along the way

  • adpath: offline BloodHound triage. Feed it a collection and it returns credential quick-wins, the shortest attack paths from your owned accounts, and a single interactive HTML kill-chain report. Because clicking around the BloodHound UI for the hundredth time gets old. "Offline" means it works on data you have already collected, without talking to the live network.
  • ADKill: an AD playbook engine. Not an autopwn tool; it launches nothing. It is a decision engine: you tell it what you have found, and it tells you what to try next and hands you the command. "I found X, try Y." A thinking aid for CTFs and pentests. A CTF (Capture The Flag) is a practice competition where you solve security puzzles to find hidden strings called flags. A pentest (penetration test) is an authorised, paid attack against a real organisation to find its weaknesses before criminals do.

What the author would tell themselves at the start

  1. Getting Domain Admin is the warm-up. The write-up that gets you hired is the one that closes the holes and proves it with numbers.
  2. Think in graphs. Individual rights are boring; their composition is the attack.
  3. Match the wordlist to the target. "Weak" is not a synonym for "in rockyou".
  4. Offence and defence are blind in different places. Run both. The scanner found two holes the attack missed, and caught a fix the author got wrong.
  5. A registry key is not a policy. If GPO manages it, fix it in GPO.

The full write-up, including the LaTeX kill-chain report, the hardening plan, the audit with raw PingCastle and Purple Knight exports, and both tools, is on GitHub: github.com/zakeelm6/ad-purple-lab. LaTeX is a typesetting system used to produce polished documents, common in academia.

Red teaches you where the holes are. Blue is where the job actually is.

Glossary

  • ACL (Access Control List): the list of permissions attached to an object, saying who may read, change or delete it.
  • Active Directory (AD): Microsoft's system for managing users, computers and permissions in an organisation.
  • adpath: a small offline tool written by the author that analyses BloodHound data and produces attack paths and a report.
  • ADKill: a small tool written by the author that suggests the next step based on what you have found; it does not attack anything itself.
  • ANSSI: the French national cybersecurity agency, which publishes AD hardening guides.
  • Anonymous LDAP enum: querying AD over LDAP without logging in.
  • AS-REP: the Kerberos reply that a Domain Controller sends when pre-authentication is disabled; it is encrypted with the user's password and can be cracked offline.
  • AS-REP roasting: requesting AS-REP blobs for accounts without pre-authentication and cracking them offline.
  • Assume-breach: a security mindset that assumes an attacker is already inside and focuses on what they can do next.
  • Baseline: a snapshot of the current state, taken before changes, used for comparison.
  • Black box: testing with no inside knowledge of how the target was built.
  • BloodHound: a free tool that maps who can act on whom in AD as a graph.
  • CIS Benchmarks: widely used hardening checklists for many products, including Windows and AD.
  • Critical IOE: an Indicator of Exposure serious enough on its own to enable significant damage.
  • CTF (Capture The Flag): a practice security competition where you solve puzzles to find hidden strings.
  • CVE: a publicly catalogued software vulnerability with an ID number.
  • DC (Domain Controller): the server that holds AD's data and answers authentication and authorisation questions.
  • DCSync: an attack that impersonates a Domain Controller to make a real one send over password data.
  • Default Domain Controllers Policy: the built-in Group Policy object that applies to Domain Controllers.
  • defaultSecurityDescriptor: the default permission list applied to new objects in the AD schema.
  • Defaults/corporate list: a wordlist of vendor default and commonly chosen corporate passwords.
  • DnsAdmins: an AD group that manages DNS; it can often be abused to run code on the DC.
  • Domain: a named group of computers and users sharing one set of rules and one central login.
  • Domain Admin: the AD group with ultimate power over a domain.
  • DONT_REQ_PREAUTH: the AD flag meaning Kerberos pre-authentication is disabled for an account.
  • DSInternals: a PowerShell module that reads AD's internal data directly, including password quality.
  • Enumeration: asking a system questions to learn what users, groups and computers exist.
  • GenericAll: an AD permission meaning full control over an object, including resetting its password.
  • gMSA (group Managed Service Account): a service account whose password Windows manages and rotates automatically.
  • GPO (Group Policy Object): a central settings container in AD that is applied to machines and users automatically.
  • GptTmpl.inf: a plain text file inside a GPO that holds security settings.
  • GRC (Governance, Risk and Compliance): the paperwork side of security: policies, risk decisions and documentation.
  • Group nesting: putting one group inside another, so members of the inner group inherit the outer group's rights.
  • Hash: a fixed-length fingerprint of a password; it cannot be reversed, but Windows will often accept it as a login.
  • hashcat: a fast password-cracking tool that tries billions of guesses against a hash.
  • Impacket: a collection of Python tools for talking to Windows networks.
  • IOE (Indicator of Exposure): a specific, named weakness reported by Purple Knight.
  • Isolated network: a network that can talk internally but not to the internet or anything else.
  • Kali: a Linux distribution pre-loaded with security tools.
  • Kerberoasting: requesting Kerberos service tickets and cracking them offline to recover service account passwords.
  • Kerberos: the authentication system AD uses, based on tickets.
  • Kill chain: the sequence of steps an attacker takes from first contact to full control.
  • KVM/libvirt: free software for running virtual machines.
  • LaTeX: a typesetting system for producing polished documents.
  • LDAP (Lightweight Directory Access Protocol): the language used to query AD.
  • LDAP signing: a setting that makes LDAP clients prove their identity cryptographically, preventing tampering.
  • LM: a very old, very weak Windows authentication protocol.
  • MemberOf: an AD relationship meaning one object is a member of a group.
  • MITRE ATT&CK: a catalogue of real attacker techniques, each with an ID.
  • NetExec (nxc): a tool that talks to Windows machines over the network to test logins and more.
  • NIST CSF 2.0: a US government framework for organising security work into categories.
  • Non-delegable: an account setting that prevents the account being used to impersonate a user to another service.
  • NTDS.dit: the database file on a Domain Controller holding every account and password hash in the domain.
  • NTLM / NTLMv1: older Windows authentication protocols; NTLMv1 is the weakest and should be disabled.
  • Pass-the-Hash: logging in using a stolen password hash instead of the plain password.
  • Pentest (penetration test): an authorised, paid attack against a real organisation to find weaknesses.
  • PingCastle: a free tool that scores an AD domain's risk from 0 (best) to 100 (worst).
  • PowerShell: Windows' built-in scripting language.
  • Pre-authentication: the step in Kerberos where the user must prove they know their password before receiving a ticket.
  • Print Spooler: the Windows service that handles printing; it has had serious exploitable bugs.
  • PrinterBug / PrintNightmare: well-known attacks against the Windows Print Spooler.
  • Protected Users: a built-in AD group that applies extra protections to its members.
  • Purple Knight: a free Semperis tool that grades an AD domain like a report card and lists IOEs.
  • Purple team: a security team that combines attack (red) and defence (blue) work.
  • Registry: Windows' central settings database.
  • rockyou: a famous leaked password list, widely used for cracking.
  • Runbook: a written, repeatable procedure.
  • Schema: the blueprint that defines what objects and permissions AD can hold.
  • SecLists: a large public collection of security wordlists.
  • secretsdump: an Impacket tool that extracts credential data from Windows systems.
  • Service account: an account used by software rather than a person.
  • SMB (Server Message Block): the protocol Windows machines use to share files and authenticate.
  • SPN (Service Principal Name): an AD attribute marking an account as running a service.
  • SYSVOL: a shared folder replicated to every Domain Controller, where GPO files live.
  • UPN (User Principal Name): the login name in email format, like [redacted].
  • Virtual machine (VM): a whole computer running inside a window on another computer.
  • Wordlist: a text file of candidate passwords or usernames, one per line.

Similar reports

Same bug class and techniques, clearest first.