2021-02-10 17:44:15 +01:00
|
|
|
|
[metadata]
|
|
|
|
|
|
creation_date = "2021/01/19"
|
2023-01-04 09:30:07 -05:00
|
|
|
|
integration = ["endpoint"]
|
2021-02-10 17:44:15 +01:00
|
|
|
|
maturity = "production"
|
2022-08-24 10:38:49 -06:00
|
|
|
|
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
|
|
|
|
|
min_stack_version = "8.3.0"
|
2023-10-23 16:28:58 +02:00
|
|
|
|
updated_date = "2023/09/22"
|
2021-02-10 17:44:15 +01:00
|
|
|
|
|
|
|
|
|
|
[rule]
|
|
|
|
|
|
author = ["Elastic"]
|
|
|
|
|
|
description = """
|
|
|
|
|
|
Both ~/.bash_profile and ~/.bashrc are files containing shell commands that are run when Bash is invoked. These files
|
|
|
|
|
|
are executed in a user's context, either interactively or non-interactively, when a user logs in so that their
|
|
|
|
|
|
environment is set correctly. Adversaries may abuse this to establish persistence by executing malicious content
|
|
|
|
|
|
triggered by a user’s shell.
|
|
|
|
|
|
"""
|
|
|
|
|
|
false_positives = ["Changes to the Shell Profile tend to be noisy, a tuning per your environment will be required."]
|
|
|
|
|
|
from = "now-9m"
|
|
|
|
|
|
index = ["logs-endpoint.events.*", "auditbeat-*"]
|
|
|
|
|
|
language = "kuery"
|
2021-03-03 22:12:11 -09:00
|
|
|
|
license = "Elastic License v2"
|
2021-02-10 17:44:15 +01:00
|
|
|
|
name = "Bash Shell Profile Modification"
|
|
|
|
|
|
references = ["https://www.anomali.com/blog/pulling-linux-rabbit-rabbot-malware-out-of-a-hat"]
|
|
|
|
|
|
risk_score = 47
|
|
|
|
|
|
rule_id = "e6c1a552-7776-44ad-ae0f-8746cc07773c"
|
|
|
|
|
|
severity = "medium"
|
2023-10-23 16:28:58 +02:00
|
|
|
|
tags = ["Domain: Endpoint",
|
|
|
|
|
|
"OS: macOS",
|
|
|
|
|
|
"OS: Linux",
|
|
|
|
|
|
"Use Case: Threat Detection",
|
|
|
|
|
|
"Tactic: Persistence",
|
|
|
|
|
|
"Data Source: Elastic Defend"
|
|
|
|
|
|
]
|
2021-02-17 19:49:58 -09:00
|
|
|
|
timestamp_override = "event.ingested"
|
2021-02-10 17:44:15 +01:00
|
|
|
|
type = "query"
|
|
|
|
|
|
|
|
|
|
|
|
query = '''
|
|
|
|
|
|
event.category:file and event.type:change and
|
2023-10-23 16:28:58 +02:00
|
|
|
|
process.name:(* and not (sudo or vim or zsh or env or nano or bash or Terminal or xpcproxy or login or cat or cp or
|
|
|
|
|
|
launchctl or java or dnf or tailwatchd or ldconfig or yum or semodule or cpanellogd or dockerd or authselect or chmod or
|
|
|
|
|
|
dnf-automatic or git or dpkg or platform-python)) and
|
|
|
|
|
|
not process.executable:(/Applications/* or /private/var/folders/* or /usr/local/* or /opt/saltstack/salt/bin/*) and
|
2021-02-10 17:44:15 +01:00
|
|
|
|
file.path:(/private/etc/rc.local or
|
|
|
|
|
|
/etc/rc.local or
|
|
|
|
|
|
/home/*/.profile or
|
|
|
|
|
|
/home/*/.profile1 or
|
|
|
|
|
|
/home/*/.bash_profile or
|
|
|
|
|
|
/home/*/.bash_profile1 or
|
|
|
|
|
|
/home/*/.bashrc or
|
|
|
|
|
|
/Users/*/.bash_profile or
|
|
|
|
|
|
/Users/*/.zshenv)
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
[[rule.threat]]
|
|
|
|
|
|
framework = "MITRE ATT&CK"
|
2023-10-23 16:28:58 +02:00
|
|
|
|
|
2021-02-10 17:44:15 +01:00
|
|
|
|
[[rule.threat.technique]]
|
|
|
|
|
|
id = "T1546"
|
|
|
|
|
|
name = "Event Triggered Execution"
|
|
|
|
|
|
reference = "https://attack.mitre.org/techniques/T1546/"
|
2023-10-23 16:28:58 +02:00
|
|
|
|
|
2021-02-10 17:44:15 +01:00
|
|
|
|
[[rule.threat.technique.subtechnique]]
|
|
|
|
|
|
id = "T1546.004"
|
2021-08-04 14:16:10 -08:00
|
|
|
|
name = "Unix Shell Configuration Modification"
|
2021-02-10 17:44:15 +01:00
|
|
|
|
reference = "https://attack.mitre.org/techniques/T1546/004/"
|
|
|
|
|
|
|
|
|
|
|
|
[rule.threat.tactic]
|
|
|
|
|
|
id = "TA0003"
|
|
|
|
|
|
name = "Persistence"
|
|
|
|
|
|
reference = "https://attack.mitre.org/tactics/TA0003/"
|