Detection rules › Elastic

Linux Hidden File Mounted

Source
github.com/elastic/protections-artifacts

Detects when a hidden file gets mounted. This is suspicious behavior, and has been observed in MacOS and Linux malware samples.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Detects when a hidden file gets mounted. This is suspicious behavior, and has been observed in MacOS and Linux malware
samples.
"""
id = "5b544dbb-2c66-42cd-a4ee-8d1e5afe9903"
license = "Elastic License v2"
name = "Linux Hidden File Mounted"
os_list = ["linux"]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and (
  process.name in ("mount", "pmount", "lsblk") or 
  (process.name == "udisksctl" and process.args == "mount") 
) and process.args like ("/media/.*", "/mnt/.*", "/tmp/mnt/.*") and 
not process.parent.command_line == "/usr/sbin/automount --pid-file /var/run/autofs.pid"
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[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 = "T1211"
name = "Exploitation for Defense Evasion"
reference = "https://attack.mitre.org/techniques/T1211/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and (
  process.name in ("mount", "pmount", "lsblk") or 
  (process.name == "udisksctl" and process.args == "mount") 
) and process.args like ("/media/.*", "/mnt/.*", "/tmp/mnt/.*") and 
not process.parent.command_line == "/usr/sbin/automount --pid-file /var/run/autofs.pid"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.command_lineeq/usr/sbin/automount --pid-file /var/run/autofs.pidexcludes:process.parent.command_line field:"process.parent.command_line" value:"/usr/sbin/automount --pid-file /var/run/autofs.pid"

Indicators

These rows show field, operator, and value matches.