The following analytic identifies when a new certificate is requested and/or granted against the Active Directory Certificate Services (AD CS) using a Subject Alternative Name (SAN). This action by its self is not malicious, however improperly configured certificate templates can be abused to permit privilege escalation and environment compromise due to over permissive settings (AD CS ESC1)
- Type: TTP
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2023-05-25
- Author: Steven Dick
- ID: cbe761fc-d945-4c8c-a71d-e26d12255d32
Kill Chain Phase
- CIS 10
1 2 3 4 5 6 7 8 9 10 11 12 13 `wineventlog_security` EventCode IN (4886,4887) Attributes="*SAN:*upn*" Attributes="*CertificateTemplate:*" | stats count min(_time) as firstTime max(_time) as lastTime values(name) as name values(status) as status values(Subject) as ssl_subject values(SubjectKeyIdentifier) as ssl_hash by Computer, EventCode, Requester, Attributes, RequestId | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | rex field=Attributes "(?i)CertificateTemplate:(?<object>[^\r\n]+)" | rex field=Attributes "(?i)ccm:(?<req_src>[^\r\n]+)" | rex max_match=10 field=Attributes "(?i)(upn=(?<req_user_1>[^\r\n&]+))" | rex max_match=10 field=Attributes "(?i)(dns=(?<req_dest_1>[^\r\n&]+))" | rex field=Requester "(.+\\\\)?(?<src_user>[^\r\n]+)" | eval flavor_text = case(EventCode=="4886","A suspicious certificate was requested using request ID: ".'RequestId',EventCode=="4887", "A suspicious certificate was issued using request ID: ".'RequestId'.". To revoke this certifacte use this request ID or the SSL fingerprint [".'ssl_hash'."]"), dest = upper(coalesce(req_dest_1,req_dest_2)), src = upper(coalesce(req_src,Computer)) | fields - req_* | rename Attributes as object_attrs, EventCode as signature_id, name as signature, RequestId as ssl_serial, Requester as ssl_subject_common_name | `windows_steal_authentication_certificates___esc1_abuse_filter`
The SPL above uses the following Macros:
windows_steal_authentication_certificates_-_esc1_abuse_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
List of fields required to use this analytic.
How To Implement
To implement this analytic, enhanced Audit Logging must be enabled on AD CS and within Group Policy Management for CS server. See Page 115 of first reference. Recommend throttle correlation by RequestId/ssl_serial at minimum.
Known False Positives
False positives may be generated in environments where administrative users or processes are allowed to generate certificates with Subject Alternative Names. Sources or templates used in these processes may need to be tuned out for accurate function.
Associated Analytic Story
|60.0||100||60||Possible AD CS ESC1 activity by $src_user$ - $flavor_text$|
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
source | version: 1