Skip to content
Access control Write-up Advanced

Modifying Certipy to Evade Microsoft Defender for Identity PKINIT Detection

Microsoft Defender for Identity (MDI) detects Certipy's PKINIT authentication by fingerprinting the encryption types advertised in the AS-REQ. By modifying Certipy to advertise a larger list of encryption types, the author bypassed the MDI alert while still exploiting ESC 1.

research.aurainfosec.io

Published on research.aurainfosec.io

Exploiting Active Directory Certificate Services (AD CS) was still one of the most common pathways to escalate privileges within an Active Directory environment in 2024. In an attempt to tackle this, Microsoft Defender for Identity (MDI) has improved their ability to detect suspicious certificate usage.

The author, on research.aurainfosec.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the detection relied on a static fingerprint of encryption types in the AS-REQ, which could be evaded by changing the advertised list.

Impact

The modification bypassed the MDI high severity alert for suspicious certificate usage over Kerberos (PKINIT) while still using Certipy, as of 22nd January 2025 on MDI Sensor 2.240.18385; the bypass is not foolproof as MDI could add detections based on Impacket's Kerberos implementation.

What the attacker needed

AD CS misconfiguration (ESC 1); Modified Certipy tool; MDI sensor present

How it was found

  1. Observe that Certipy's PKINIT AS-REQ advertises only encryption types 18 and 17.
  2. Modify Certipy to advertise a larger list of encryption types, similar to those used by kinit.
  3. Run the modified Certipy to perform PKINIT authentication and obtain a TGT.
  4. Check MDI for new incidents or alerts; none are generated.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Active Directory Certificate Services (AD CS) can be misconfigured to let attackers request certificates that grant high privileges. Tools like Certipy exploit this by using a certificate to authenticate via Kerberos (PKINIT) and get a ticket. Microsoft Defender for Identity (MDI) watches for this by noticing that Certipy's authentication request lists only certain encryption types, unlike normal Windows requests. The author changed Certipy to list more encryption types, making its request look more normal and avoiding the alert.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.