Files
sigma-rules/rules/macos/defense_evasion_modify_environment_launchctl.toml
T
Justin Ibarra 59da2da474 [Rule Tuning] Ensure host information is in endpoint rule queries (#2593)
* add unit tests to ensure host type and platform are included
* add host.os.name 'linux' to all linux rules
* add host.os.name macos to mac rules
* add host.os.name to windows rules; fix linux dates
* update from host.os.name to host.os.type

Co-authored-by: brokensound77 <brokensound77@users.noreply.github.com>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
2023-03-05 11:41:19 -07:00

68 lines
2.4 KiB
TOML

[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/"