Detection rules › Elastic

Common Language Runtime Loaded via an Unsigned Module

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

Identifies the load of the Microsoft Common Language Runtime DLL CLR.dll from a recently dropped unsigned DLL.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = "Identifies the load of the Microsoft Common Language Runtime DLL CLR.dll from a recently dropped unsigned DLL."
id = "d8d90a1a-a912-4716-994b-26e24d363d76"
license = "Elastic License v2"
name = "Common Language Runtime Loaded via an Unsigned Module"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.20"

query = '''
sequence by process.entity_id with maxspan=1m
 [library where
  dll.Ext.relative_file_creation_time <= 300 and
  dll.code_signature.trusted  != true and not startswith~(dll.name, process.name) and
  dll.hash.sha256 : "??*" and dll.path : "?*" and
  (process.code_signature.subject_name : "Microsoft*" or process.code_signature.exists == false) and
  not dll.code_signature.status : ("trusted", "errorCode_endpoint*") and
  not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\System32\\DriverStore\\FileRepository\\*") and
  not dll.path : ("?:\\Windows\\assembly\\NativeImages_v*",
                  "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                  "?:\\Windows\\SoftwareDistribution\\Download\\*",
                  "?:\\Windows\\WinSxS\\*",
                  "?:\\Program Files\\*",
                  "?:\\Program Files (x86)\\*") and
  not dll.hash.sha256 : "f51ff500ace815d2d2213fe961a2080f8b7da98474d7a7736a49961938e1028e"] as event0
 [library where dll.name : "clr.dll" and
  stringcontains~(process.thread.Ext.call_stack_summary, concat("mscoreei.dll|", event0.dll.name)) and
  not process.thread.Ext.call_stack_summary : "*mscoreei.dll|msi*.tmp|msi.dll*"]
'''

min_endpoint_version = "8.10.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.10.0"

Stages and Predicates

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

Stage 1: library

[library where
  dll.Ext.relative_file_creation_time <= 300 and
  dll.code_signature.trusted  != true and not startswith~(dll.name, process.name) and
  dll.hash.sha256 : "??*" and dll.path : "?*" and
  (process.code_signature.subject_name : "Microsoft*" or process.code_signature.exists == false) and
  not dll.code_signature.status : ("trusted", "errorCode_endpoint*") and
  not process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\System32\\DriverStore\\FileRepository\\*") and
  not dll.path : ("?:\\Windows\\assembly\\NativeImages_v*",
                  "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                  "?:\\Windows\\SoftwareDistribution\\Download\\*",
                  "?:\\Windows\\WinSxS\\*",
                  "?:\\Program Files\\*",
                  "?:\\Program Files (x86)\\*") and
  not dll.hash.sha256 : "f51ff500ace815d2d2213fe961a2080f8b7da98474d7a7736a49961938e1028e"] as event0

Stage 2: library

[library where dll.name : "clr.dll" and
  stringcontains~(process.thread.Ext.call_stack_summary, concat("mscoreei.dll|", event0.dll.name)) and
  not process.thread.Ext.call_stack_summary : "*mscoreei.dll|msi*.tmp|msi.dll*"]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuswildcardtrusted, errorCode_endpoint*excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorCode_endpoint*"
dll.hash.sha256eqf51ff500ace815d2d2213fe961a2080f8b7da98474d7a7736a49961938e1028eexcludes:dll.hash.sha256 field:"dll.hash.sha256" value:"f51ff500ace815d2d2213fe961a2080f8b7da98474d7a7736a49961938e1028e"
dll.namestarts_withprocess.nameexcludes:dll.name field:"dll.name" value:"process.name"
dll.pathstarts_with?:\Windows\assembly\NativeImages_v, ?:\Windows\System32\DriverStore\FileRepository\, ?:\Windows\SoftwareDistribution\Download\, ?:\Windows\WinSxS\, ?:\Program Files\, ?:\Program Files (x86)\excludes:dll.path
process.executablestarts_with?:\Program Files\, ?:\Program Files (x86)\, ?:\Windows\System32\DriverStore\FileRepository\excludes:process.executable field:"process.executable" value:"?:\Program Files\" field:"process.executable" value:"?:\Program Files (x86)\" field:"process.executable" value:"?:\Windows\System32\DriverStore\FileRepository\"
process.thread.Ext.call_stack_summarywildcard*mscoreei.dll|msi*.tmp|msi.dll*excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"*mscoreei.dll|msi*.tmp|msi.dll*"

Indicators

These rows show field, operator, and value matches.