Creation of Hidden Shared Object File


Description

Identifies the creation of a hidden shared object (.so) file. Users can mark specific files as hidden simply by putting a "." as the first character in the file or folder name. Adversaries can use this to their advantage to hide files and folders on the system for persistence and defense evasion.

Query · eql

file where event.type == "creation" and file.name like~ ".*.so" and (
  process.name in (
    "sudo", "link", "find", "xargs", "install", "coreutils", "gzip", "bzip2", "mv", "ln", "busybox",
    "bash", "zsh", "sh", "tcsh", "csh", "ksh", "fish", "mksh", "touch", "curl", "wget"
  ) or
  process.name like ".*" or
  process.executable like (
    "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*", "/home/*"
  )
) and
not (
  process.executable like (
    "/home/*/.opencode/bin/opencode", "/home/*/.nvm/*/bin/kilo", "/home/*/.vscode-server/*/server/node",
    "/home/*/.local/share/containers/storage/overlay/*/opencode", "./usr/bin/podman",
    "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode", "/home/*/.aimee-code/bin/opencode",
    "/root/.opencode/bin/opencode", "/home/*/.opencode/bin/.nfs*",
    "/home/*/.vscode/extensions/kilocode.kilo-code-*/bin/kilo",
    "/home/*/.vscode-server/extensions/kilocode.kilo-code-*/bin/kilo",
    "/root/.vscode-server/extensions/kilocode.kilo-code-*/bin/kilo"
  ) or
  file.name like ("._*", ".*-00000000.so") or
  file.path like ("/home/*/.local/share/containers/storage/overlay/*", "/scratch/user/*/ZEBULON/CODE/.files-libLocal.so")
)
Raw source Creation of Hidden Shared Object File · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Identifies the creation of a hidden shared object (.so) file. Users can mark specific files as hidden simply by putting
a "." as the first character in the file or folder name. Adversaries can use this to their advantage to hide files and
folders on the system for persistence and defense evasion.
"""
id = "61b20f0f-d342-4b32-bc77-195037b0dc82"
license = "Elastic License v2"
name = "Creation of Hidden Shared Object File"
os_list = ["linux"]
version = "1.0.4"

query = '''
file where event.type == "creation" and file.name like~ ".*.so" and (
  process.name in (
    "sudo", "link", "find", "xargs", "install", "coreutils", "gzip", "bzip2", "mv", "ln", "busybox",
    "bash", "zsh", "sh", "tcsh", "csh", "ksh", "fish", "mksh", "touch", "curl", "wget"
  ) or
  process.name like ".*" or
  process.executable like (
    "./*", "/dev/shm/*", "/tmp/*", "/var/tmp/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
    "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/root/*", "/home/*"
  )
) and
not (
  process.executable like (
    "/home/*/.opencode/bin/opencode", "/home/*/.nvm/*/bin/kilo", "/home/*/.vscode-server/*/server/node",
    "/home/*/.local/share/containers/storage/overlay/*/opencode", "./usr/bin/podman",
    "/usr/local/share/npm-global/lib/node_modules/opencode-ai/bin/.opencode", "/home/*/.aimee-code/bin/opencode",
    "/root/.opencode/bin/opencode", "/home/*/.opencode/bin/.nfs*",
    "/home/*/.vscode/extensions/kilocode.kilo-code-*/bin/kilo",
    "/home/*/.vscode-server/extensions/kilocode.kilo-code-*/bin/kilo",
    "/root/.vscode-server/extensions/kilocode.kilo-code-*/bin/kilo"
  ) or
  file.name like ("._*", ".*-00000000.so") or
  file.path like ("/home/*/.local/share/containers/storage/overlay/*", "/scratch/user/*/ZEBULON/CODE/.files-libLocal.so")
)
'''

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 = "T1129"
name = "Shared Modules"
reference = "https://attack.mitre.org/techniques/T1129/"


[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[[threat.technique.subtechnique]]
id = "T1564.001"
name = "Hidden Files and Directories"
reference = "https://attack.mitre.org/techniques/T1564/001/"



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

[internal]
min_endpoint_version = "7.15.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.