Detection rules › Splunk

Certificate Abuse - Windows (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Threat actors may use tools such as Certipy or Certify.exe to enumerate misconfigurations in certificate services, allowing them to gather information on potential vulnerabilities that could be exploited for privilege escalation or lateral movement within a network. This use case identifies potential abuse of Active Directory Certificate Services by monitoring Certificate Services events (4886 and 4887) or process creation events (event ID 4688) involving tools commonly used to exploit vulnerable configurations in AD CS such as certify.exe, accounting for instances where the binary has been renamed.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

References

Telemetry coverage

Rule body

id: '38494.69236'
title: Certificate Abuse - Windows
description: Threat actors may use tools such as Certipy or Certify.exe to enumerate
  misconfigurations in certificate services, allowing them to gather information on
  potential vulnerabilities that could be exploited for privilege escalation or lateral
  movement within a network. This use case identifies potential abuse of Active Directory
  Certificate Services by monitoring Certificate Services events (4886 and 4887) or
  process creation events (event ID 4688) involving tools commonly used to exploit
  vulnerable configurations in AD CS such as certify.exe, accounting for instances
  where the binary has been renamed.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4886) OR
  "<EventID>4886<" OR TERM(EventCode=4887) OR "<EventID>4887<") OR ((TERM(EventCode=4688)
  OR "<EventID>4688<" OR Type=Process) ("certify.exe" OR "request " OR "/ca:" OR "/template:"
  OR "/altname:")) | where match(signature_id, "4886|4887") or (match(signature_id,
  "4688") and match(process, "(?i)request\s.+/ca:.+/(template|altname):")) | table
  _time, host, user user, process, process_*, parent_*, signature_id | bin span=1s
  | stats values(*) as * by _time, host '
techniques:
- credential-access:steal or forge authentication certificates
technique_id: 
- T1649
data_category:
- Windows event logs
references:
- https://github.com/ly4k/Certipy
- https://www.kali.org/tools/certipy-ad/
- https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4886) OR "<EventID>4886<" OR TERM(EventCode=4887) OR "<EventID>4887<") OR ((TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ("certify.exe" OR "request " OR "/ca:" OR "/template:" OR "/altname:"))

Stage 2: where

| where match(signature_id, "4886|4887") or (match(signature_id, "4688") and match(process, "(?i)request\s.+/ca:.+/(template|altname):"))

Stage 3: table

| table _time, host, user user, process, process_*, parent_*, signature_id

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
  • 4886 corpus 2 (splunk 2)
  • 4887 corpus 3 (splunk 3)
field:"EventID" kind:eq
processregex_match
  • "(?i)request\s.+/ca:.+/(template|altname):" corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match
signature_idregex_match
  • "4688" corpus 8 (splunk 8)
    • "4886
    • 4887"
field:"signature_id" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4886<"
1"<EventID>4887<"
1"<EventID>4688<"
1"certify.exe"
1"request "
1"/ca:"
1"/template:"
1"/altname:"