Skip to content

Commit 65bc776

Browse files
authored
Merge pull request #1088 from HackTricks-wiki/research_update_src_windows-hardening_active-directory-methodology_ad-certificates_20250710_083127
Add content: Research Update Enhanced src/windows-hardening/active-direct...
2 parents 2fe2c17 + ac802f9 commit 65bc776

1 file changed

Lines changed: 38 additions & 5 deletions

File tree

src/windows-hardening/active-directory-methodology/ad-certificates.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,53 @@ Certify.exe cas
113113
# Identify vulnerable certificate templates with Certify
114114
Certify.exe find /vulnerable
115115

116-
# Use Certipy for enumeration and identifying vulnerable templates
117-
certipy find -vulnerable -u john@corp.local -p Passw0rd -dc-ip 172.16.126.128
116+
# Use Certipy (>=4.0) for enumeration and identifying vulnerable templates
117+
certipy find -vulnerable -dc-only -u john@corp.local -p Passw0rd -target dc.corp.local
118+
119+
# Request a certificate over the web enrollment interface (new in Certipy 4.x)
120+
certipy req -web -target ca.corp.local -template WebServer -upn john@corp.local -dns www.corp.local
118121

119122
# Enumerate Enterprise CAs and certificate templates with certutil
120123
certutil.exe -TCAInfo
121124
certutil -v -dstemplate
122125
```
123126

127+
---
128+
129+
## Recent Vulnerabilities & Security Updates (2022-2025)
130+
131+
| Year | ID / Name | Impact | Key Take-aways |
132+
|------|-----------|--------|----------------|
133+
| 2022 | **CVE-2022-26923** – “Certifried” / ESC6 | *Privilege escalation* by spoofing machine account certificates during PKINIT. | Patch is included in the **May 10 2022** security updates. Auditing & strong-mapping controls were introduced via **KB5014754**; environments should now be in *Full Enforcement* mode. citeturn2search0 |
134+
| 2023 | **CVE-2023-35350 / 35351** | *Remote code-execution* in the AD CS Web Enrollment (certsrv) and CES roles. | Public PoCs are limited, but the vulnerable IIS components are often exposed internally. Patch as of **July 2023** Patch Tuesday. citeturn3search0 |
135+
| 2024 | **CVE-2024-49019** – “EKUwu” / ESC15 | Low-privileged users with enrollment rights could override **any** EKU or SAN during CSR generation, issuing certificates usable for client-authentication or code-signing and leading to *domain compromise*. | Addressed in **April 2024** updates. Remove “Supply in the request” from templates and restrict enrollment permissions. citeturn1search3 |
136+
137+
### Microsoft hardening timeline (KB5014754)
138+
139+
Microsoft introduced a three-phase rollout (Compatibility → Audit → Enforcement) to move Kerberos certificate authentication away from weak implicit mappings. As of **February 11 2025**, domain controllers automatically switch to **Full Enforcement** if the `StrongCertificateBindingEnforcement` registry value is not set. Administrators should:
140+
141+
1. Patch all DCs & AD CS servers (May 2022 or later).
142+
2. Monitor Event ID 39/41 for weak mappings during the *Audit* phase.
143+
3. Re-issue client-auth certificates with the new **SID extension** or configure strong manual mappings before February 2025. citeturn2search0
144+
145+
---
146+
147+
## Detection & Hardening Enhancements
148+
149+
* **Defender for Identity AD CS sensor (2023-2024)** now surfaces posture assessments for ESC1-ESC8/ESC11 and generates real-time alerts such as *“Domain-controller certificate issuance for a non-DC”* (ESC8) and *“Prevent Certificate Enrollment with arbitrary Application Policies”* (ESC15). Ensure sensors are deployed to all AD CS servers to benefit from these detections. citeturn5search0
150+
* Disable or tightly scope the **“Supply in the request”** option on all templates; prefer explicitly defined SAN/EKU values.
151+
* Remove **Any Purpose** or **No EKU** from templates unless absolutely required (addresses ESC2 scenarios).
152+
* Require **manager approval** or dedicated Enrollment Agent workflows for sensitive templates (e.g., WebServer / CodeSigning).
153+
* Restrict web enrollment (`certsrv`) and CES/NDES endpoints to trusted networks or behind client-certificate authentication.
154+
* Enforce RPC enrollment encryption (`certutil –setreg CA\InterfaceFlags +IF_ENFORCEENCRYPTICERTREQ`) to mitigate ESC11.
155+
156+
---
157+
124158
## References
125159

126160
- [https://www.specterops.io/assets/resources/Certified_Pre-Owned.pdf](https://www.specterops.io/assets/resources/Certified_Pre-Owned.pdf)
127161
- [https://comodosslstore.com/blog/what-is-ssl-tls-client-authentication-how-does-it-work.html](https://comodosslstore.com/blog/what-is-ssl-tls-client-authentication-how-does-it-work.html)
162+
- [https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16](https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16)
163+
- [https://advisory.eventussecurity.com/advisory/critical-vulnerability-in-ad-cs-allows-privilege-escalation/](https://advisory.eventussecurity.com/advisory/critical-vulnerability-in-ad-cs-allows-privilege-escalation/)
128164

129165
{{#include ../../banners/hacktricks-training.md}}
130-
131-
132-

0 commit comments

Comments
 (0)