Windows Steal Authentication Certificates CryptoAPI

Original Source: [splunk source]
Name:Windows Steal Authentication Certificates CryptoAPI
id:905d5692-6d7c-432f-bc7e-a6b4f464d40e
version:3
date:2024-09-30
author:Michael Haag, Splunk
status:production
type:Anomaly
Description:The following analytic detects the extraction of authentication certificates using Windows Event Log - CAPI2 (CryptoAPI 2). It leverages EventID 70, which is generated when a certificate's private key is acquired. This detection is significant because it can identify potential misuse of certificates, such as those extracted by tools like Mimikatz or Cobalt Strike. If confirmed malicious, this activity could allow attackers to impersonate users, escalate privileges, or access sensitive information, posing a severe risk to the organization's security.
Data_source:
  • -Windows Event Log CAPI2 70
search:`capi2_operational` EventCode=70
| xmlkv UserData_Xml
| stats count min(_time) as firstTime max(_time) as lastTime by Computer, UserData_Xml
| rename Computer as dest
| `security_content_ctime(firstTime)`| `security_content_ctime(lastTime)`
| `windows_steal_authentication_certificates_cryptoapi_filter`


how_to_implement:To implement this analytic, one will need to enable the Microsoft-Windows-CAPI2/Operational log within the Windows Event Log. Note this is a debug log for many purposes, and the analytic only focuses in on EventID 70. Review the following gist for additional enabling information.
known_false_positives:False positives may be present in some instances of legitimate applications requiring to export certificates. Filter as needed.
References:
  -https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc749296(v=ws.10)
drilldown_searches:
name:'View the detection results for - "$dest$"'
search:'%original_detection_search% | search dest = "$dest$"'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
name:'View risk events for the last 7 days for - "$dest$"'
search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
tags:
  analytic_story:
    - 'Windows Certificate Services'
  asset_type:Endpoint
  confidence:80
  impact:30
  message:Certificates were exported via the CryptoAPI 2 on $dest$.
  mitre_attack_id:
    - 'T1649'
  observable:
    name:'dest'
    type:'Hostname'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'Computer'
    - 'UserData_Xml'
  risk_score:24
  security_domain:endpoint

tests:
name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1649/atomic_red_team/capi2-operational.log
  source: XmlWinEventLog:Microsoft-Windows-CAPI2/Operational
  sourcetype: XmlWinEventLog
  update_timestamp: True
manual_test:None

Related Analytic Stories


Windows Certificate Services