Detection rules › Elastic
Sensitive File Access via Perl
Detects when Perl accesses sensitive files. Perl is a scripting language that comes pre-installed on macOS and can be abused by adversaries for credential access.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Credential Access |
Telemetry coverage
| Platform | Record / event type |
|---|---|
| macOS | ESF event open (NOTIFY): Fires after the kernel grants a process access to open a file. |
Rule body
[rule]
description = """
Detects when Perl accesses sensitive files. Perl is a scripting language that comes pre-installed on macOS and can be
abused by adversaries for credential access.
"""
id = "7d5a6969-3da8-4b41-a016-87077f49fb1c"
license = "Elastic License v2"
name = "Sensitive File Access via Perl"
os_list = ["macos"]
version = "1.0.3"
query = '''
file where event.action == "open" and (process.name == "perl" or Effective_process.name == "perl")
'''
min_endpoint_version = "8.16.0"
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[[threat.technique.subtechnique]]
id = "T1552.001"
name = "Credentials In Files"
reference = "https://attack.mitre.org/techniques/T1552/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: file
file where event.action == "open" and (process.name == "perl" or Effective_process.name == "perl")
Indicators
These rows show field, operator, and value matches.