Detection rules › Elastic

Process Execution from Boot Directory

Source
github.com/elastic/protections-artifacts

This rule detects the execution of processes from the /boot directory. This may indicate an attempt to execute a process from a location that is not typical for executable files. This behavior is often associated with malicious activity.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
This rule detects the execution of processes from the /boot directory. This may indicate an attempt to execute a process
from a location that is not typical for executable files. This behavior is often associated with malicious activity.
"""
id = "87bd993d-d2fa-4047-bc7b-d6a4527d6ab8"
license = "Elastic License v2"
name = "Process Execution from Boot Directory"
os_list = ["linux"]
version = "1.0.11"

query = '''
process where event.type == "start" and event.action == "exec" and process.executable like "/boot/*" and
not (
  process.executable in ("/boot/loader/entries", "/boot/dietpi/dietpi-login") or
  process.parent.executable in (
    "/boot/dietpi/dietpi-update", "/etc/cron.daily/dietpi", "/etc/cron.hourly/dietpi", "/boot/dietpi/dietpi-login"
  )
)
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.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 = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"

[[threat.technique]]
id = "T1620"
name = "Reflective Code Loading"
reference = "https://attack.mitre.org/techniques/T1620/"


[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.executable like "/boot/*" and
not (
  process.executable in ("/boot/loader/entries", "/boot/dietpi/dietpi-login") or
  process.parent.executable in (
    "/boot/dietpi/dietpi-update", "/etc/cron.daily/dietpi", "/etc/cron.hourly/dietpi", "/boot/dietpi/dietpi-login"
  )
)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablein/boot/dietpi/dietpi-login, /boot/loader/entriesexcludes:process.executable field:"process.executable" value:"/boot/dietpi/dietpi-login" field:"process.executable" value:"/boot/loader/entries"
process.parent.executablein/boot/dietpi/dietpi-login, /boot/dietpi/dietpi-update, /etc/cron.daily/dietpi, /etc/cron.hourly/dietpiexcludes:process.parent.executable

Indicators

These rows show field, operator, and value matches.