Detection rules › Elastic

Suspicious Credential Files Creation via Kerberos

Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies network connections to the standard Kerberos or SMB ports from an unusual process followed by the creation of a sensitive file such as kerberos ticket and certificate keys. On Windows, the only native system process that normally performs Kerberos traffic from a domain joined host is lsass.exe and SMB is the System virtual process. This may indicate an ongoing Kerberos attack.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies network connections to the standard Kerberos or SMB ports from an unusual process followed by the creation of
a sensitive file such as kerberos ticket and certificate keys. On Windows, the only native system process that normally
performs Kerberos traffic from a domain joined host is lsass.exe and SMB is the System virtual process. This may
indicate an ongoing Kerberos attack.
"""
id = "ced93ac0-f153-402f-9239-17ae32f304e2"
license = "Elastic License v2"
name = "Suspicious Credential Files Creation via Kerberos"
os_list = ["windows"]
reference = [
    "https://research.ifcr.dk/certipy-2-0-bloodhound-new-escalations-shadow-credentials-golden-certificates-and-more-34d1c26f0dc6",
    "https://posts.specterops.io/certified-pre-owned-d95910965cd2",
]
version = "1.0.30"

query = '''
sequence by process.entity_id with maxspan=1m

 [network where
   destination.port in (88, 445) and source.port >= 49152 and
   network.direction == "egress" and network.transport == "tcp" and
   process.pid != 4 and
   not process.executable :
              ("?:\\Windows\\System32\\lsass.exe",
               "\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
               "?:\\Program Files (x86)\\*.exe",
               "?:\\Program Files\\*.exe")]

 [file where event.action in ("creation", "overwrite") and

   /* dumping PFX, CCACHE or KIRBI via kerberos */
   (file.extension in~ ("ccache", "pfx", "kirbi") or file.Ext.header_bytes : ("0504*", "3082*", "768*")) and
   not (process.name : "powershell.exe" and file.path : "?:\\Windows\\ServiceProfiles\\LocalService\\AppData\\*") and
   not (process.code_signature.trusted == true and process.code_signature.subject_name in ("KASEYA US LLC", "The Apache Software Foundation")) and
   not file.path like "C:\\Users\\*\\AppData\\LocalLow\\Microsoft\\CryptnetUrlCache\\Content\\*"]
'''

min_endpoint_version = "8.0.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1558"
name = "Steal or Forge Kerberos Tickets"
reference = "https://attack.mitre.org/techniques/T1558/"


[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"



[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.

Stage 1: network

[network where
   destination.port in (88, 445) and source.port >= 49152 and
   network.direction == "egress" and network.transport == "tcp" and
   process.pid != 4 and
   not process.executable :
              ("?:\\Windows\\System32\\lsass.exe",
               "\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
               "?:\\Program Files (x86)\\*.exe",
               "?:\\Program Files\\*.exe")]

Stage 2: file

[file where event.action in ("creation", "overwrite") and
   (file.extension in~ ("ccache", "pfx", "kirbi") or file.Ext.header_bytes : ("0504*", "3082*", "768*")) and
   not (process.name : "powershell.exe" and file.path : "?:\\Windows\\ServiceProfiles\\LocalService\\AppData\\*") and
   not (process.code_signature.trusted == true and process.code_signature.subject_name in ("KASEYA US LLC", "The Apache Software Foundation")) and
   not file.path like "C:\\Users\\*\\AppData\\LocalLow\\Microsoft\\CryptnetUrlCache\\Content\\*"]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Windows\System32\lsass.exe, \Device\HarddiskVolume*\Windows\System32\lsass.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exeexcludes:process.executable
file.pathstarts_with?:\Windows\ServiceProfiles\LocalService\AppData\excludes:file.path field:"file.path" value:"?:\Windows\ServiceProfiles\LocalService\AppData\"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.code_signature.subject_nameinKASEYA US LLC, The Apache Software Foundationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"KASEYA US LLC" field:"process.code_signature.subject_name" value:"The Apache Software Foundation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
file.pathwildcardC:\Users\*\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*excludes:file.path field:"file.path" value:"C:\Users\*\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content\*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
destination.portin
  • 445 transforms: number corpus 10 (elastic 7, splunk 2, sigma 1)
  • 88 transforms: number corpus 7 (elastic 4, sigma 2, splunk 1)
field:"DestinationPort" kind:in
event.actionin
  • creation corpus 58 (elastic 58)
  • overwrite corpus 8 (elastic 8)
field:"EventType" kind:in
file.Ext.header_byteswildcard
  • 0504*
  • 3082*
  • 768*
field:"file.Ext.header_bytes" kind:wildcard
file.extensionin
  • ccache
  • kirbi
  • pfx
field:"file.extension" kind:in
network.directioneq
  • egress corpus 17 (elastic 17)
field:"Initiated" kind:eq value:"egress"
network.transporteq
  • tcp corpus 26 (elastic 25, sigma 1)
field:"Protocol" kind:eq value:"tcp"
process.pidne
  • 4 transforms: number corpus 44 (elastic 44)
field:"process_id" kind:ne value:"4"
source.portge
  • 49152 transforms: number corpus 16 (elastic 16)
field:"SourcePort" kind:ge value:"49152"