Active Directory Certificate Services – ESC1

๐Ÿ”’ Secure Bits ๐Ÿ’ก

Have you ever heard of ๐—˜๐—ฆ๐—– ๐˜ƒ๐˜‚๐—น๐—ป๐—ฒ๐—ฟ๐—ฎ๐—ฏ๐—ถ๐—น๐—ถ๐˜๐—ถ๐—ฒ๐˜€? I guess you have.

If you’re running ๐—”๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐——๐—ถ๐—ฟ๐—ฒ๐—ฐ๐˜๐—ผ๐—ฟ๐˜† ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ ๐—ฆ๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฐ๐—ฒ๐˜€ (๐—”๐—— ๐—–๐—ฆ) and haven’t audited it for ESC misconfigurations – you may be sitting on a ๐˜๐—ถ๐—ฐ๐—ธ๐—ถ๐—ป๐—ด ๐˜๐—ถ๐—บ๐—ฒ ๐—ฏ๐—ผ๐—บ๐—ฏ. ๐Ÿ’ฃ

๐ŸŽฏ ESC vulnerabilities (Enterprise PKI Escalation Paths) are incredibly ๐—ฐ๐—ผ๐—บ๐—บ๐—ผ๐—ป and highly ๐—ฑ๐—ฎ๐—ป๐—ด๐—ฒ๐—ฟ๐—ผ๐˜‚๐˜€. Yetโ€ฆ most environments I assess treat AD CS like a black box – โ€œItโ€™s working, so letโ€™s not touch it.โ€

But attackers love AD CS – it often lets them ๐—ฒ๐˜€๐—ฐ๐—ฎ๐—น๐—ฎ๐˜๐—ฒ ๐˜๐—ผ ๐——๐—ผ๐—บ๐—ฎ๐—ถ๐—ป ๐—”๐—ฑ๐—บ๐—ถ๐—ป using just a basic user account. No exploits. Just misconfigurations.

๐—Ÿ๐—ฒ๐˜โ€™๐˜€ ๐—ฏ๐—ฟ๐—ฒ๐—ฎ๐—ธ ๐—ฑ๐—ผ๐˜„๐—ป ๐—˜๐—ฆ๐—–๐Ÿญ ๐Ÿ‘‡

ESC1 = Certificate Template Misconfig

It lets a regular user request a certificate that can later be used to authenticate as someone else – including privileged users.

๐—ง๐—ผ ๐—ฏ๐—ฒ ๐˜ƒ๐˜‚๐—น๐—ป๐—ฒ๐—ฟ๐—ฎ๐—ฏ๐—น๐—ฒ, ๐—ฎ๐—น๐—น ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ๐˜€๐—ฒ ๐—ฎ๐—ฟ๐—ฒ ๐˜๐—ฟ๐˜‚๐—ฒ:

โœ… Non-privileged users can enroll in a certificate template

โœ… Manager approval is not required

โœ… No authorized signature is required

โœ… The template supports client authentication (PKINIT, Smart Card, etc.)

โœ… The requester can define the Subject Alternative Name (SAN)

๐—˜๐—ป๐—ฑ ๐—ฟ๐—ฒ๐˜€๐˜‚๐—น๐˜?

A low-privileged user can impersonate anyone – including a Domain Admin – using the certificate.

๐Ÿ› ๏ธ ๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฒ๐—ป๐˜ƒ๐—ถ๐—ฟ๐—ผ๐—ป๐—บ๐—ฒ๐—ป๐˜?

The simplest thing to do is running ๐—Ÿ๐—ผ๐—ฐ๐—ธ๐˜€๐—บ๐—ถ๐˜๐—ต ๐Ÿฎ by Jake Hildreth. Quick and straightforward – the screenshot is from the tool.

(๐Ÿ”— https://github.com/jakehildreth/locksmith2).

๐ŸŽฏ I got lost in them, but I believe ๐—ถ๐—ป ๐˜๐—ผ๐˜๐—ฎ๐—น ๐˜๐—ต๐—ฒ๐—ฟ๐—ฒ ๐—ถ๐˜€ ๐Ÿญ๐Ÿฒ+ ๐—˜๐—ฆ๐—–๐˜€, right? Iโ€™ll be covering them in upcoming Secure Bits posts.

๐—ฃ๐—ฆ: There might be a course focused on AD CS sooner or later…