Detection rules › Elastic

Suspicious File Quarantine Removal via Find

Time window
3s
Sequence by
Effective_process.entity_id, process.parent.entity_id
Source
github.com/elastic/protections-artifacts

Detects when the Find command is executed with the exec option in order to execute the Xattr command for removal of the file quarantine bit.

MITRE ATT&CK coverage

TacticTechniques
Defense Impairment

Telemetry coverage

Rule body

[rule]
description = """
Detects when the Find command is executed with the exec option in order to execute the Xattr command for removal of the
file quarantine bit.
"""
id = "c43102bc-f307-48a4-bfc5-a02444b3fed2"
license = "Elastic License v2"
name = "Suspicious File Quarantine Removal via Find"
os_list = ["macos"]
version = "1.0.4"

query = '''
sequence with maxspan=3s
[process where event.type == "start" and event.action == "exec" and process.name == "find" and 
  process.args in~ ("-exec", "-execdir") and 
  process.args like~ "*com.apple.quarantine*"] by process.parent.entity_id
[file where event.action == "extended_attributes_delete" and 
  process.executable like "/usr/bin/xattr"] by Effective_process.entity_id
'''

min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "Effective_process.entity_id"
state = 1

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1553"
name = "Subvert Trust Controls"
reference = "https://attack.mitre.org/techniques/T1553/"
[[threat.technique.subtechnique]]
id = "T1553.001"
name = "Gatekeeper Bypass"
reference = "https://attack.mitre.org/techniques/T1553/001/"



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

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 3s, correlated by Effective_process.entity_id, process.parent.entity_id.

Stage 1: process

[process where event.type == "start" and event.action == "exec" and process.name == "find" and 
  process.args in~ ("-exec", "-execdir") and 
  process.args like~ "*com.apple.quarantine*"] by process.parent.entity_id

Stage 2: file

[file where event.action == "extended_attributes_delete" and 
  process.executable like "/usr/bin/xattr"] by Effective_process.entity_id

Indicators

These rows show field, operator, and value matches.