Detection rules › Elastic
Creation of Hidden Shared Object File
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.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule body
[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.3"
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"
) 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"
Stages and Predicates
Stage 1: file
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"
) or
file.name like ("._*", ".*-00000000.so") or
file.path like ("/home/*/.local/share/containers/storage/overlay/*", "/scratch/user/*/ZEBULON/CODE/.files-libLocal.so")
)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.name | wildcard | ._*, .*-00000000.so | excludes:file.name field:"file.name" value:"._*" field:"file.name" value:".*-00000000.so" |
file.path | wildcard | /home/*/.local/share/containers/storage/overlay/*, /scratch/user/*/ZEBULON/CODE/.files-libLocal.so | excludes:file.path field:"file.path" value:"/home/*/.local/share/containers/storage/overlay/*" field:"file.path" value:"/scratch/user/*/ZEBULON/CODE/.files-libLocal.so" |
process.executable | wildcard | /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 | excludes:process.executable |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"creation" |
file.name | wildcard |
| field:"file.name" kind:wildcard value:".*.so" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | in |
| field:"process_name" kind:in |
process.name | wildcard |
| field:"process_name" kind:wildcard value:".*" |