Detection rules › Elastic

Data Encrypted and Archived

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

Identifies when data is encrypted and archived using common compression and encryption tools. This activity can indicate an attempt to collect sensitive data and stage it for exfiltration.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Identifies when data is encrypted and archived using common compression and encryption tools. This activity can indicate
an attempt to collect sensitive data and stage it for exfiltration.
"""
id = "2454d6fc-1ff8-4a59-8bcf-d6e8c4bb2c09"
license = "Elastic License v2"
name = "Data Encrypted and Archived"
os_list = ["macos"]
reference = [
    "https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/",
    "https://www.virustotal.com/gui/file/71e35aef03099cd1f2d6446734273025a163597de93912df321ef118bf135238",
]
version = "1.0.4"

query = '''
sequence by process.parent.entity_id with maxspan=10s
  [process where event.type == "start" and event.action in ("exec", "start") and process.name : ("openssl", "openssl.exe") and
  process.args : ("enc", "pkeyutl", "cms", "smime")]
  [process where event.type == "start" and event.action in ("exec", "start") and
  process.name : (
    "tar", "zip", "gzip", "xz", "7z", "7za", "7zr", "bzip2", "zstd",
    "tar.exe", "zip.exe", "gzip.exe", "7z.exe", "7za.exe", "7zr.exe", "bzip2.exe", "zstd.exe", "zstd64.exe"
  ) and
  not (
    process.parent.args in (
      "/opt/rudder/share/commands/agent-run", "/usr/sbin/backup_orbini", "/usr/local/bin/mariadb-backup.sh",
      "/usr/local/bin/drupal-per-site-backup.sh"
    ) or
    process.parent.args like "mariabackup*db_backup*" or
    process.parent.command_line like (
      "*mysqldump*localhost*/storage/backup*", "*/etc/pve*prox_backup*", "*/home/*/.local/bin/authd*"
    ) or
    process.parent.executable == "/opt/rudder/bin/rudder" or
    process.working_directory like "/mnt/vstk/queue/*" or
    process.args like "/var/rudder/tmp/reports/*" or
    (process.name == "tar" and process.working_directory like "/u/sysdat/*") or
    (
      (process.parent.executable == "/home/backup/backup.sh" or process.parent.args == "/backup/backup_temp") and
      process.working_directory like "/storage/*"
    )
  )]
'''

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

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

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

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.013"
name = "Encrypted/Encoded File"
reference = "https://attack.mitre.org/techniques/T1027/013/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1074"
name = "Data Staged"
reference = "https://attack.mitre.org/techniques/T1074/"
[[threat.technique.subtechnique]]
id = "T1074.001"
name = "Local Data Staging"
reference = "https://attack.mitre.org/techniques/T1074/001/"



[threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.type == "start" and event.action in ("exec", "start") and process.name : ("openssl", "openssl.exe") and
  process.args : ("enc", "pkeyutl", "cms", "smime")]

Stage 2: process

[process where event.type == "start" and event.action in ("exec", "start") and
  process.name : (
    "tar", "zip", "gzip", "xz", "7z", "7za", "7zr", "bzip2", "zstd",
    "tar.exe", "zip.exe", "gzip.exe", "7z.exe", "7za.exe", "7zr.exe", "bzip2.exe", "zstd.exe", "zstd64.exe"
  ) and
  not (
    process.parent.args in (
      "/opt/rudder/share/commands/agent-run", "/usr/sbin/backup_orbini", "/usr/local/bin/mariadb-backup.sh",
      "/usr/local/bin/drupal-per-site-backup.sh"
    ) or
    process.parent.args like "mariabackup*db_backup*" or
    process.parent.command_line like (
      "*mysqldump*localhost*/storage/backup*", "*/etc/pve*prox_backup*", "*/home/*/.local/bin/authd*"
    ) or
    process.parent.executable == "/opt/rudder/bin/rudder" or
    process.working_directory like "/mnt/vstk/queue/*" or
    process.args like "/var/rudder/tmp/reports/*" or
    (process.name == "tar" and process.working_directory like "/u/sysdat/*") or
    (
      (process.parent.executable == "/home/backup/backup.sh" or process.parent.args == "/backup/backup_temp") and
      process.working_directory like "/storage/*"
    )
  )]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.argseq/backup/backup_tempexcludes:process.parent.args field:"process.parent.args" value:"/backup/backup_temp"
process.parent.executableeq/home/backup/backup.shexcludes:process.parent.executable field:"process.parent.executable" value:"/home/backup/backup.sh"
process.working_directorystarts_with/storage/excludes:process.working_directory field:"process.working_directory" value:"/storage/"
process.nameeqtarexcludes:process.name field:"process.name" value:"tar"
process.working_directorystarts_with/u/sysdat/excludes:process.working_directory field:"process.working_directory" value:"/u/sysdat/"
process.argsstarts_with/var/rudder/tmp/reports/excludes:process.args field:"process.args" value:"/var/rudder/tmp/reports/"
process.parent.argsin/opt/rudder/share/commands/agent-run, /usr/local/bin/drupal-per-site-backup.sh, /usr/local/bin/mariadb-backup.sh, /usr/sbin/backup_orbiniexcludes:process.parent.args
process.parent.argswildcardmariabackup*db_backup*excludes:process.parent.args field:"process.parent.args" value:"mariabackup*db_backup*"
process.parent.command_linewildcard*mysqldump*localhost*/storage/backup*, */etc/pve*prox_backup*, */home/*/.local/bin/authd*excludes:process.parent.command_line field:"process.parent.command_line" value:"*mysqldump*localhost*/storage/backup*" field:"process.parent.command_line" value:"*/etc/pve*prox_backup*" field:"process.parent.command_line" value:"*/home/*/.local/bin/authd*"
process.parent.executableeq/opt/rudder/bin/rudderexcludes:process.parent.executable field:"process.parent.executable" value:"/opt/rudder/bin/rudder"
process.working_directorystarts_with/mnt/vstk/queue/excludes:process.working_directory field:"process.working_directory" value:"/mnt/vstk/queue/"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actionin
  • exec
  • start
field:"EventType" kind:in
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argswildcard
  • cms
  • enc
  • pkeyutl
  • smime
field:"process.args" kind:wildcard
process.namewildcard
  • 7z
  • 7z.exe
  • 7za
  • 7za.exe
  • 7zr
  • 7zr.exe
  • bzip2
  • bzip2.exe
  • gzip
  • gzip.exe
  • openssl
  • openssl.exe
  • tar
  • tar.exe
  • xz
  • zip
  • zip.exe
  • zstd
  • zstd.exe
  • zstd64.exe
field:"process_name" kind:wildcard