forked from elastic/detection-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefense_evasion_modify_environment_launchctl.toml
67 lines (59 loc) · 2.36 KB
/
defense_evasion_modify_environment_launchctl.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[metadata]
creation_date = "2021/01/14"
integration = ["endpoint"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/02/22"
[rule]
author = ["Elastic"]
description = """
Identifies modifications to an environment variable using the built-in launchctl command. Adversaries may execute their
own malicious payloads by hijacking certain environment variables to load arbitrary libraries or bypass certain
restrictions.
"""
from = "now-9m"
index = ["auditbeat-*", "logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License v2"
name = "Modification of Environment Variable via Launchctl"
references = [
"https://github.com/rapid7/metasploit-framework/blob/master//modules/post/osx/escalate/tccbypass.rb",
]
risk_score = 47
rule_id = "7453e19e-3dbf-4e4e-9ae0-33d6c6ed15e1"
severity = "medium"
tags = ["Elastic", "Host", "macOS", "Threat Detection", "Defense Evasion"]
timestamp_override = "event.ingested"
type = "query"
query = '''
event.category:process and host.os.type:macos and event.type:start and
process.name:launchctl and
process.args:(setenv and not (JAVA*_HOME or
RUNTIME_JAVA_HOME or
DBUS_LAUNCHD_SESSION_BUS_SOCKET or
ANT_HOME or
LG_WEBOS_TV_SDK_HOME or
WEBOS_CLI_TV or
EDEN_ENV)
) and
not process.parent.executable:("/Applications/NoMachine.app/Contents/Frameworks/bin/nxserver.bin" or
"/usr/local/bin/kr" or
"/Applications/NoMachine.app/Contents/Frameworks/bin/nxserver.bin" or
"/Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home/lib/jspawnhelper") and
not process.args : "*.vmoptions"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[rule.threat.technique.subtechnique]]
id = "T1574.007"
name = "Path Interception by PATH Environment Variable"
reference = "https://attack.mitre.org/techniques/T1574/007/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"