b4c84e8a40
* Update Tags * Bump updated date separately to be easy to revert if needed * Update resource_development_ml_linux_anomalous_compiler_activity.toml * Apply changes from the discussion * Update persistence_init_d_file_creation.toml * Update defense_evasion_timestomp_sysmon.toml * Update defense_evasion_application_removed_from_blocklist_in_google_workspace.toml * Update missing Tactic tags * Update unit tests to match new tags * Add missing IG tags * Delete okta_threat_detected_by_okta_threatinsight.toml * Update command_and_control_google_drive_malicious_file_download.toml * Update persistence_rc_script_creation.toml * Mass bump * Update persistence_shell_activity_by_web_server.toml * . --------- Co-authored-by: Mika Ayenson <Mika.ayenson@elastic.co> Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
61 lines
2.3 KiB
TOML
61 lines
2.3 KiB
TOML
[metadata]
|
|
creation_date = "2023/02/28"
|
|
integration = ["endpoint"]
|
|
maturity = "production"
|
|
min_stack_comments = "New fields added: required_fields, related_integrations, setup, New Term"
|
|
min_stack_version = "8.6.0"
|
|
updated_date = "2023/04/05"
|
|
|
|
[rule]
|
|
author = ["Elastic"]
|
|
description = """
|
|
Message of the day (MOTD) is the message that is presented to the user when a user connects to a Linux server via SSH or
|
|
a serial connection. Linux systems contain several default MOTD files located in the "/etc/update-motd.d/" and
|
|
"/usr/lib/update-notifier/" directories. These scripts run as the root user every time a user connects over SSH or a
|
|
serial connection. Adversaries may create malicious MOTD files that grant them persistence onto the target every time a
|
|
user connects to the system by executing a backdoor script or command. This rule detects the creation of potentially
|
|
malicious files within the default MOTD file directories.
|
|
"""
|
|
from = "now-9m"
|
|
index = ["logs-endpoint.events.*", "endgame-*"]
|
|
language = "kuery"
|
|
license = "Elastic License v2"
|
|
name = "Potential Persistence Through MOTD File Creation Detected"
|
|
references = [
|
|
"https://pberba.github.io/security/2022/02/06/linux-threat-hunting-for-persistence-initialization-scripts-and-shell-configuration/#10-boot-or-logon-initialization-scripts-motd"
|
|
]
|
|
risk_score = 47
|
|
rule_id = "96d11d31-9a79-480f-8401-da28b194608f"
|
|
severity = "medium"
|
|
tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Endgame"]
|
|
type = "new_terms"
|
|
|
|
query = '''
|
|
host.os.type :"linux" and event.action:("creation" or "file_create_event" or "rename" or "file_rename_event") and
|
|
file.path : (/etc/update-motd.d/* or /usr/lib/update-notifier/*) and not
|
|
process.executable : ("/usr/bin/dpkg" or "/usr/bin/dockerd" or "/bin/rpm") and not
|
|
file.extension : "swp"
|
|
'''
|
|
|
|
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
[[rule.threat.technique]]
|
|
id = "T1037"
|
|
name = "Boot or Logon Initialization Scripts"
|
|
reference = "https://attack.mitre.org/techniques/T1037/"
|
|
|
|
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0003"
|
|
name = "Persistence"
|
|
reference = "https://attack.mitre.org/tactics/TA0003/"
|
|
|
|
|
|
[rule.new_terms]
|
|
field = "new_terms_fields"
|
|
value = ["file.path", "process.name"]
|
|
[[rule.new_terms.history_window_start]]
|
|
field = "history_window_start"
|
|
value = "now-7d" |