Detection rules › Elastic
Unusual Dylib Load from Users Shared Directory
Detects when a dylib gets loaded from an unusual location ("/usr/local/lib") by an application in the /Users/Shared directory. This is highly uncommon and has been used by the LightSpy malware when loading post-exploitation modules.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Detects when a dylib gets loaded from an unusual location ("/usr/local/lib") by an application in the /Users/Shared
directory. This is highly uncommon and has been used by the LightSpy malware when loading post-exploitation modules.
"""
id = "99ab55b4-03c9-4d1c-8766-6cf6d01fd5a2"
license = "Elastic License v2"
name = "Unusual Dylib Load from Users Shared Directory"
os_list = ["macos"]
reference = ["https://www.huntress.com/blog/lightspy-malware-variant-targeting-macos"]
version = "1.0.5"
query = '''
library where event.action == "load" and dll.path like "/usr/local/lib/*" and
(process.executable like "/Users/Shared/*" or Effective_process.executable like "/Users/Shared/*")
'''
min_endpoint_version = "8.11.1"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.11.1"
Stages and Predicates
Stage 1: library
library where event.action == "load" and dll.path like "/usr/local/lib/*" and
(process.executable like "/Users/Shared/*" or Effective_process.executable like "/Users/Shared/*")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Effective_process.executable | wildcard |
| field:"Effective_process.executable" kind:wildcard value:"/Users/Shared/*" |
dll.path | wildcard |
| field:"ImageLoaded" kind:wildcard value:"/usr/local/lib/*" |
event.action | eq |
| field:"EventType" kind:eq value:"load" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"/Users/Shared/*" |