LESSON 57 · INTERMEDIATE9 min read

Windows and AD Hardening, Detection, and Recovery

Reduce the attack surface of Windows and Active Directory, verify the controls with evidence, detect credential attacks, and recover a domain after compromise.

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 tiered administration, LAPS, and Protected Users to contain credential theft.
  • Reduce NTLM, SMB, LDAP, and Kerberos weaknesses without breaking the business.
  • Harden AD CS, patching, backup, and domain recovery procedures.
  • Configure audit policy and use key event IDs to detect directory attacks.
  • Build a detection and incident response plan that covers domain dominance.

01Tiered Administration, LAPS, and Protected Users

Tiered administration is the backbone of Windows hardening. Tier 0 includes domain controllers, the directory, certificate authorities, and the systems that administer them. Tier 1 includes member servers and applications. Tier 2 includes workstations and user devices. Each tier gets separate administrative accounts, and privileged work happens from a hardened privileged access workstation or jump host. Logon restrictions should prevent Tier 0 accounts from signing in to Tier 1 and Tier 2 systems, because a compromised workstation must not be able to harvest domain-controller credentials.

Local Administrator Password Solution (LAPS) removes a widespread weakness: the same local administrator password on every machine. LAPS generates a unique password per computer, rotates it, and stores it in Active Directory or another protected store with delegated read permissions. Attackers who obtain one local admin password can no longer reuse it across the estate. Windows LAPS supports password encryption and recovery scenarios; legacy LAPS uses different attributes. Whichever version you deploy, restrict who can read the password, audit every retrieval, and verify that rotation is actually happening.

Protected Users is a security group that applies strong restrictions to its members. Members cannot use NTLM, DES, or RC4 for authentication, cannot be delegated, do not get cached credentials, and cannot use unconstrained delegation. These protections make credential theft and relay much harder for privileged users. The group can break legacy applications, so test it before adding service accounts or administrators who rely on older protocols. Add human Tier 0 administrators first, verify their workflows, and treat exceptions as temporary findings rather than permanent configuration.

02Close the Legacy Doors: NTLM, SMB, LDAP, and Kerberos

NTLM remains common for compatibility, but it has no mutual authentication and supports relay attacks. Audit where NTLM is still used before disabling it. Windows policy can restrict outbound NTLM to remote servers, block it entirely, or audit it first. Monitor 4624 logons with NTLM authentication, application logs, and legacy device behaviour. Disable NTLM where possible, require it only for documented exceptions, and prefer Kerberos with AES. The goal is not to flip a switch everywhere at once; it is to reduce the paths an attacker can relay or replay.

SMB signing protects file-share traffic from tampering and relay, and SMB encryption protects data in transit. Disable SMB1, require signing on servers and clients where supported, and review any legacy device that cannot comply. LDAP signing and channel binding protect directory authentication from relay attacks. On domain controllers, verify LDAPServerIntegrity and LdapEnforceChannelBinding in the NTDS parameters, enable LDAPS where appropriate, and test applications before enforcing strict settings. Each of these controls has a compatibility cost, so roll out in audit mode and measure the exceptions.

Kerberos should use AES rather than RC4 or DES. Review msDS-SupportedEncryptionTypes for user and service accounts, remove obsolete encryption types from domain policy, and rotate the krbtgt password on a schedule with a documented procedure. Disable legacy name resolution protocols such as LLMNR and NBT-NS where they are not needed, remove WINS, retire SMB1, disable the Print Spooler on domain controllers unless it is required, and keep Windows Firewall enabled on every profile. These are unglamorous changes, but they remove entire categories of attack.

03AD CS, Patching, Backup, and Recovery

Active Directory Certificate Services issues credentials that can outlive a password reset, so the CA and its templates are Tier 0 assets. Review every template for who can enroll, whether the requester can supply a subject or SAN, which EKUs are allowed, and whether manager approval is required. Remove templates that allow client authentication without proper controls. Restrict enrollment and CA management permissions, disable insecure HTTP enrollment, enable Extended Protection for Authentication where supported, use strong key sizes, and audit certificate issuance and template changes. A single vulnerable template can undo years of password hygiene.

Patching is a security control, not an IT chore. Domain controllers, member servers, workstations, and the hypervisor all need a predictable patch cadence with emergency handling for actively exploited vulnerabilities. Track exposure, test critical updates, and keep a rollback plan. Backups must cover system state, SYSVOL, Group Policy, and the directory. Test restores regularly, because a backup that has never been restored is only a hope. The AD recycle bin helps with accidental object deletion, but it is not a substitute for a full recovery capability.

Domain recovery requires a plan. If a domain controller is compromised, isolate it, preserve evidence, and rebuild rather than clean it when trust cannot be restored. A forest recovery may involve restoring the first DC from a known-good backup in Directory Services Restore Mode (DSRM), seizing FSMO roles, resetting the krbtgt password twice, restoring SYSVOL, and validating replication before returning services. Run the DSU (directory services update) and post-restore health checks your platform requires, then prove that authentication and Group Policy work from a member server. Keep at least one offline or immutable backup that ransomware and stolen domain credentials cannot reach. Rehearse the procedure in a lab; the middle of an incident is a poor time to read the runbook for the first time.

04Audit Policy, Event IDs, and Detection Engineering

Windows only logs what audit policy enables. Configure advanced audit policy for logon, account management, directory service access, policy change, privilege use, and process creation. Turn on command-line process auditing and PowerShell script block logging where appropriate, increase Security log size, and forward events to a central system that attackers cannot easily delete. Protect the log pipeline itself: a sudden drop in events, a disabled audit policy, or a cleared log is a security signal. Retention must match the investigation and legal requirements.

Several event IDs form the core of AD detection. 4624 records a successful logon, including the logon type and authentication package. 4625 records a failure. 4768 records a Kerberos TGT request, and 4769 records a service ticket request. 4771 records Kerberos pre-authentication failure. 4662 records directory object access when auditing is configured, which is how replication-rights abuse such as DCSync can appear. 5136 records a directory service object change. Supplement these with 4720 for user creation, 4728 and 4732 for privileged group changes, 4756 for universal group changes, 7045 for new services, 1102 for log clearing, and 4740 for account lockout.

Detection engineering turns these events into hypotheses. A Kerberoasting hypothesis might alert on 4769 with RC4 encryption from a workstation that has no business requesting service tickets. A DCSync hypothesis might alert on 4662 with replication GUIDs from a non-DC source. A password spray hypothesis might correlate 4625 failures across many accounts from one address. A Golden ticket hypothesis might look for TGT lifetimes outside policy or service ticket requests without a preceding TGT. Baseline normal behaviour, document false positives, and attach a runbook to every high-severity rule.

05Detection in Depth and Incident Response

Endpoint and identity telemetry complement the Security log. Sysmon records process creation, network connections, image loads, remote thread creation, process access, file creation, registry changes, and DNS queries. Process access events aimed at LSASS are especially relevant to credential dumping. Microsoft Defender for Identity sensors on domain controllers analyse authentication traffic and directory behaviour, surfacing reconnaissance, compromised credentials, lateral movement, and domain dominance. Endpoint detection and response adds behavioural detections on servers and workstations. No single sensor sees the whole attack.

Honeytokens provide high-confidence alerts with low noise. Create a decoy user account with an attractive name and no legitimate purpose, a fake privileged group, or a service account with an SPN that is never used. Any authentication, ticket request, or group change involving the decoy is worth investigating. Place canary files on sensitive shares and alert on access. Honeytokens do not replace prevention, but they catch attackers who enumerate broadly and cannot tell a trap from a real target. Keep the decoys documented so responders do not waste time treating them as real users.

Incident response for a domain compromise is different from a single-host incident. Containment may require isolating domain controllers, disabling compromised accounts, resetting privileged credentials, and resetting the krbtgt password twice with replication in between to invalidate forged tickets. Preserve logs and memory where safe, scope every account and system the attacker touched, and assume persistence until proven otherwise. After recovery, verify replication, review directory permissions and GPOs, rotate secrets, and monitor closely for return activity. A blameless review should turn every gap into an owned, tested improvement.

ad-hardening-checks.ps1Plain text
# Run in an elevated PowerShell session on a lab domain controller.Get-ADGroupMember "Domain Admins" -Recursive | Select-Object Name, SamAccountNameGet-ADGroupMember "Protected Users" -ErrorAction SilentlyContinueGet-ADUser -Filter * -Properties DoesNotRequirePreAuth |  Where-Object DoesNotRequirePreAuth -eq $true |  Select-Object SamAccountNameGet-ADUser -Filter * -Properties msDS-SupportedEncryptionTypes |  Where-Object { ($_.msDS-SupportedEncryptionTypes -band 0x18) -eq 0 } |  Select-Object SamAccountName, msDS-SupportedEncryptionTypesGet-SmbServerConfiguration |  Select-Object EnableSMB1Protocol, EnableSecuritySignature, RequireSecuritySignature, EncryptDataGet-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" |  Select-Object LDAPServerIntegrity, LdapEnforceChannelBindingGet-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" |  Select-Object RestrictSendingNTLMTraffic, RestrictReceivingNTLMTrafficGet-ADComputer -Filter * -Properties msLAPS-Password, ms-Mcs-AdmPwd |  Select-Object Name, msLAPS-Password, ms-Mcs-AdmPwdauditpol /get /category:*Get-WinEvent -ListLog Security | Select-Object LogName, MaximumSizeInBytes, RecordCountrepadmin /showrepldcdiag /test:dns /v
Outputstdout
Domain Admins: 3 members
Protected Users: 2 members
Accounts without pre-authentication: 0
Accounts without AES: 1 (legacy-svc)
SMB1: False   Signing required: True
LDAPServerIntegrity: 2   Channel binding: 2
NTLM outbound restriction: 1 (audit)
LAPS coverage: 18 of 20 computers
Security log: 1,048,576 KB, 412,993 records
Replication: 4 of 4 connections succeeded
LET IT CLICK

The ideas worth keeping.

  • Tiered administration, LAPS, and Protected Users reduce where privileged credentials can be used and stolen.
  • NTLM, SMB, LDAP, and Kerberos weaknesses have compatibility costs, so audit, stage, and verify each restriction.
  • AD CS, patching, and tested backups are part of identity security because certificates and directory data are credentials.
  • Detection needs identity, endpoint, and directory telemetry, plus a rehearsed recovery plan that includes krbtgt resets.
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: Build a verification matrix

Choose five controls: LAPS coverage, Protected Users membership, SMB signing, LDAP signing and channel binding, and NTLM restriction. For each, write the command or console path that verifies it, the expected healthy result, and one reason the control matters.

Explore a worked solution
one_possible_solution.mdCybersecurity
1. LAPS: Get-ADComputer -Filter * -Properties msLAPS-Password | Where-Object { -not $_.'msLAPS-Password' } and check the LAPS operational event log; expect every in-scope computer to have a managed password. 2. Protected Users: Get-ADGroupMember 'Protected Users'; expect all Tier 0 human admins and no incompatible service accounts. 3. SMB signing: Get-SmbServerConfiguration; expect RequireSecuritySignature True on servers where supported. 4. LDAP: Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters; expect LDAPServerIntegrity 2 and LdapEnforceChannelBinding 2. 5. NTLM: audit 4624 NTLM logons and the RestrictSendingNTLMTraffic policy; expect a documented exception list trending down. Record the date, host, output, and owner for each check.

A control is only real when it can be verified. The matrix turns a policy statement into evidence that a reviewer or auditor can reproduce.

02

Exercise 2: Investigate a service ticket burst

A domain controller logs 200 events with ID 4769 in four minutes. Most use RC4 encryption, come from one workstation, and target 40 different service accounts. The workstation belongs to a helpdesk user who is online. What is your triage and response?

Explore a worked solution
one_possible_solution.mdCybersecurity
Treat it as possible Kerberoasting. Confirm the source host and user, the requested SPNs, encryption types, and whether the requests succeeded. Check the workstation for unusual processes, scheduled tasks, and recently downloaded files, and review the user's recent logons and email for phishing. Contact the user out of band. If the activity is not authorised, isolate the workstation, disable or reset the account, revoke sessions, and review the targeted service accounts for weak passwords, shared credentials, and excessive privileges. Preserve the 4769 events and endpoint telemetry. Remediate by moving services to gMSAs, setting long random passwords, requiring AES, removing unused SPNs, and tuning a detection for RC4 ticket bursts from workstations.

A burst of service ticket requests from one workstation is unusual because normal applications request tickets for a small number of services. Encryption type and SPN diversity are strong triage signals.

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 combination most directly reduces the impact of pass-the-hash?
02What is the main purpose of LAPS?
03What does event ID 4769 record?

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.