@@ -45,17 +45,18 @@ def initialize(info = {})
45
45
allows enrollment in and which SIDs are authorized to use that certificate server to
46
46
perform this enrollment operation.
47
47
48
- Currently the module is capable of checking for certificates that are vulnerable to ESC1, ESC2, ESC3, and
49
- ESC13 . The module is limited to checking for these techniques due to them being identifiable remotely from a
50
- normal user account by analyzing the objects in LDAP.
48
+ Currently the module is capable of checking for certificates that are vulnerable to ESC1, ESC2, ESC3, ESC13,
49
+ and ESC15 . The module is limited to checking for these techniques due to them being identifiable remotely from
50
+ a normal user account by analyzing the objects in LDAP.
51
51
} ,
52
52
'Author' => [
53
53
'Grant Willcox' , # Original module author
54
- 'Spencer McIntyre' # ESC13 update
54
+ 'Spencer McIntyre' # ESC13 and ESC15 updates
55
55
] ,
56
56
'References' => [
57
57
[ 'URL' , 'https://posts.specterops.io/certified-pre-owned-d95910965cd2' ] ,
58
- [ 'URL' , 'https://posts.specterops.io/adcs-esc13-abuse-technique-fda4272fbd53' ] # ESC13
58
+ [ 'URL' , 'https://posts.specterops.io/adcs-esc13-abuse-technique-fda4272fbd53' ] , # ESC13
59
+ [ 'URL' , 'https://trustedsec.com/blog/ekuwu-not-just-another-ad-cs-esc' ] # ESC15
59
60
] ,
60
61
'DisclosureDate' => '2021-06-17' ,
61
62
'License' => MSF_LICENSE ,
@@ -373,6 +374,21 @@ def find_esc13_vuln_cert_templates
373
374
end
374
375
end
375
376
377
+ def find_esc15_vuln_cert_templates
378
+ esc_raw_filter = '(&' \
379
+ '(objectclass=pkicertificatetemplate)' \
380
+ '(!(mspki-enrollment-flag:1.2.840.113556.1.4.804:=2))' \
381
+ '(|(mspki-ra-signature=0)(!(mspki-ra-signature=*)))' \
382
+ '(pkiextendedkeyusage=*)' \
383
+ '(mspki-certificate-name-flag:1.2.840.113556.1.4.804:=1)' \
384
+ '(mspki-template-schema-version=1)' \
385
+ ')'
386
+ notes = [
387
+ 'ESC15: Request can specify a subjectAltName (msPKI-Certificate-Name-Flag) and EKUs can be altered (msPKI-Template-Schema-Version)'
388
+ ]
389
+ query_ldap_server_certificates ( esc_raw_filter , 'ESC15' , notes : notes )
390
+ end
391
+
376
392
def find_enrollable_vuln_certificate_templates
377
393
# For each of the vulnerable certificate templates, determine which servers
378
394
# allows users to enroll in that certificate template and which users/groups
@@ -555,6 +571,7 @@ def run
555
571
find_esc2_vuln_cert_templates
556
572
find_esc3_vuln_cert_templates
557
573
find_esc13_vuln_cert_templates
574
+ find_esc15_vuln_cert_templates
558
575
559
576
find_enrollable_vuln_certificate_templates
560
577
print_vulnerable_cert_info
0 commit comments