@@ -36,17 +36,18 @@ def initialize(info = {})
36
36
allows enrollment in and which SIDs are authorized to use that certificate server to
37
37
perform this enrollment operation.
38
38
39
- Currently the module is capable of checking for certificates that are vulnerable to ESC1, ESC2, ESC3, and
40
- ESC13 . The module is limited to checking for these techniques due to them being identifiable remotely from a
41
- normal user account by analyzing the objects in LDAP.
39
+ Currently the module is capable of checking for certificates that are vulnerable to ESC1, ESC2, ESC3, ESC13,
40
+ and ESC15 . The module is limited to checking for these techniques due to them being identifiable remotely from
41
+ a normal user account by analyzing the objects in LDAP.
42
42
} ,
43
43
'Author' => [
44
44
'Grant Willcox' , # Original module author
45
- 'Spencer McIntyre' # ESC13 update
45
+ 'Spencer McIntyre' # ESC13 and ESC15 updates
46
46
] ,
47
47
'References' => [
48
48
[ 'URL' , 'https://posts.specterops.io/certified-pre-owned-d95910965cd2' ] ,
49
- [ 'URL' , 'https://posts.specterops.io/adcs-esc13-abuse-technique-fda4272fbd53' ] # ESC13
49
+ [ 'URL' , 'https://posts.specterops.io/adcs-esc13-abuse-technique-fda4272fbd53' ] , # ESC13
50
+ [ 'URL' , 'https://trustedsec.com/blog/ekuwu-not-just-another-ad-cs-esc' ] # ESC15
50
51
] ,
51
52
'DisclosureDate' => '2021-06-17' ,
52
53
'License' => MSF_LICENSE ,
@@ -238,7 +239,7 @@ def find_esc1_vuln_cert_templates
238
239
'(mspki-certificate-name-flag:1.2.840.113556.1.4.804:=1)' \
239
240
')'
240
241
notes = [
241
- 'ESC1: Request can specify a subjectAltName (msPKI-Certificate-Name-Flag)'
242
+ 'ESC1: Request can specify a subjectAltName (msPKI-Certificate-Name-Flag) and EKUs permit authentication '
242
243
]
243
244
query_ldap_server_certificates ( esc1_raw_filter , 'ESC1' , notes : notes )
244
245
end
@@ -364,6 +365,21 @@ def find_esc13_vuln_cert_templates
364
365
end
365
366
end
366
367
368
+ def find_esc15_vuln_cert_templates
369
+ esc_raw_filter = '(&' \
370
+ '(objectclass=pkicertificatetemplate)' \
371
+ '(!(mspki-enrollment-flag:1.2.840.113556.1.4.804:=2))' \
372
+ '(|(mspki-ra-signature=0)(!(mspki-ra-signature=*)))' \
373
+ '(pkiextendedkeyusage=*)' \
374
+ '(mspki-certificate-name-flag:1.2.840.113556.1.4.804:=1)' \
375
+ '(mspki-template-schema-version=1)' \
376
+ ')'
377
+ notes = [
378
+ 'ESC15: Request can specify a subjectAltName (msPKI-Certificate-Name-Flag) and EKUs can be altered (msPKI-Template-Schema-Version)'
379
+ ]
380
+ query_ldap_server_certificates ( esc_raw_filter , 'ESC15' , notes : notes )
381
+ end
382
+
367
383
def find_enrollable_vuln_certificate_templates
368
384
# For each of the vulnerable certificate templates, determine which servers
369
385
# allows users to enroll in that certificate template and which users/groups
@@ -527,6 +543,7 @@ def run
527
543
find_esc2_vuln_cert_templates
528
544
find_esc3_vuln_cert_templates
529
545
find_esc13_vuln_cert_templates
546
+ find_esc15_vuln_cert_templates
530
547
531
548
find_enrollable_vuln_certificate_templates
532
549
print_vulnerable_cert_info
0 commit comments