Hidden File Created in System Directory by Suspicious Process

Identifies an executable from a suspicious or writable location creating a hidden file in a system binary, configuration, or library directory. Adversaries may place dot-prefixed files in trusted system locations to conceal payloads, configuration, or persistence artifacts.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/10/07"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2026/10/07"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies an executable from a suspicious or writable location creating a hidden file in a system binary, configuration,
 11or library directory. Adversaries may place dot-prefixed files in trusted system locations to conceal payloads,
 12configuration, or persistence artifacts.
 13"""
 14from = "now-9m"
 15index = ["logs-endpoint.events.file*"]
 16language = "eql"
 17license = "Elastic License v2"
 18name = "Hidden File Created in System Directory by Suspicious Process"
 19note = """## Triage and analysis
 20
 21> **Disclaimer**:
 22> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 23
 24### Investigating Hidden File Created in System Directory by Suspicious Process
 25
 26Linux dot-prefixed files are hidden from default directory listings. An attacker may run a payload from a temporary,
 27shared-memory, web, home, or memory-backed location and create a hidden file under a trusted system directory to conceal
 28malware, configuration, credentials, or a persistence component.
 29
 30### Possible investigation steps
 31
 32- Review the hidden file's full path, owner, permissions, timestamps, size, hash, and file type.
 33- Examine the creating process, its parent and ancestor chain, command line, user, working directory, and executable hash.
 34- Determine how the suspicious executable reached the host by reviewing earlier file, process, and network events.
 35- Inspect the file safely for executable content, scripts, credentials, configuration, or references from services,
 36  scheduled tasks, shell profiles, or dynamic linker configuration.
 37- Check whether the file was later read, executed, renamed, loaded, deleted, or observed on other systems.
 38
 39### False positive analysis
 40
 41- Administrative scripts, security products, software installers, and configuration-management tools may create legitimate
 42  hidden files. Validate the exact file purpose, process lineage, deployment record, and host scope before adding an
 43  exception.
 44- Development, build, or container workflows may create dotfiles in unusual filesystem layouts. Confirm the destination
 45  is expected for the workflow and that the process and resulting artifact are trusted.
 46
 47### Response and remediation
 48
 49- Isolate the affected host if the process or hidden file is unauthorized.
 50- Terminate malicious processes, quarantine the file, and remove related persistence only after preserving evidence.
 51- Hunt for matching file and process hashes, names, paths, and related network indicators across the environment.
 52- Identify and remediate the initial access vector, and rotate any credentials or secrets exposed by the compromise.
 53- Restore affected system files and configuration from a trusted source and monitor for recurrence.
 54"""
 55risk_score = 73
 56rule_id = "d8949491-03f4-4af7-b095-5e0cc1b200f0"
 57setup = """## Setup
 58
 59This rule requires data coming in from Elastic Defend.
 60
 61### Elastic Defend Integration Setup
 62Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 63
 64#### Prerequisite Requirements:
 65- Fleet is required for Elastic Defend.
 66- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 67
 68#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 69- Go to the Kibana home page and click "Add integrations".
 70- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 71- Click "Add Elastic Defend".
 72- Configure the integration name and optionally add a description.
 73- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 74- Select a configuration preset. Each preset comes with different default settings, which can be customized by configuring the Elastic Defend integration policy. Select "Complete EDR (Endpoint Detection and Response)" to collect all events and preventions.
 75- Enter a name for the agent policy, or select an existing agent policy.
 76- Click "Save and Continue".
 77- To complete the integration, select "Add Elastic Agent" and follow the instructions to install the Elastic Agent on your hosts.
 78"""
 79severity = "high"
 80tags = [
 81    "Domain: Endpoint",
 82    "OS: Linux",
 83    "Use Case: Threat Detection",
 84    "Tactic: Defense Evasion",
 85    "Data Source: Elastic Defend",
 86    "Rule Type: Event Correlation (EQL)",
 87    "Resources: Investigation Guide",
 88    "Platform: Linux",
 89]
 90timestamp_override = "event.ingested"
 91type = "eql"
 92query = '''
 93file where host.os.type == "linux" and event.action in ("rename", "creation") and
 94process.executable like (
 95  "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*", "*/www/html/*",
 96  "/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/mnt/*", "/media/*", "*/wp-content/*",
 97  "*/wp-includes/*", "*/wp-admin/*", "?memfd:*", "memfd:*", "/home/*", "/root/*"
 98) and
 99file.name like ".*" and
100file.path like (
101  "/bin/*", "/usr/bin/*", "/usr/local/bin/*", "/sbin/*", "/usr/sbin/*", "/usr/local/sbin/*", "/etc/*",
102  "/lib/*", "/lib32/*", "/lib64/*", "/libx32/*", "/usr/lib/*", "/usr/lib32/*", "/usr/lib64/*",
103  "/usr/libx32/*", "/usr/local/lib/*", "/usr/local/lib32/*", "/usr/local/lib64/*", "/usr/local/libx32/*",
104  "/libexec/*", "/usr/libexec/*", "/usr/local/libexec/*", "/var/lib/*"
105)
106'''
107
108[[rule.threat]]
109framework = "MITRE ATT&CK"
110
111  [rule.threat.tactic]
112  id = "TA0005"
113  name = "Defense Evasion"
114  reference = "https://attack.mitre.org/tactics/TA0005/"
115
116  [[rule.threat.technique]]
117  id = "T1564"
118  name = "Hide Artifacts"
119  reference = "https://attack.mitre.org/techniques/T1564/"
120
121    [[rule.threat.technique.subtechnique]]
122    id = "T1564.001"
123    name = "Hidden Files and Directories"
124    reference = "https://attack.mitre.org/techniques/T1564/001/"

Triage and analysis

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Investigating Hidden File Created in System Directory by Suspicious Process

Linux dot-prefixed files are hidden from default directory listings. An attacker may run a payload from a temporary, shared-memory, web, home, or memory-backed location and create a hidden file under a trusted system directory to conceal malware, configuration, credentials, or a persistence component.

Possible investigation steps

  • Review the hidden file's full path, owner, permissions, timestamps, size, hash, and file type.
  • Examine the creating process, its parent and ancestor chain, command line, user, working directory, and executable hash.
  • Determine how the suspicious executable reached the host by reviewing earlier file, process, and network events.
  • Inspect the file safely for executable content, scripts, credentials, configuration, or references from services, scheduled tasks, shell profiles, or dynamic linker configuration.
  • Check whether the file was later read, executed, renamed, loaded, deleted, or observed on other systems.

False positive analysis

  • Administrative scripts, security products, software installers, and configuration-management tools may create legitimate hidden files. Validate the exact file purpose, process lineage, deployment record, and host scope before adding an exception.
  • Development, build, or container workflows may create dotfiles in unusual filesystem layouts. Confirm the destination is expected for the workflow and that the process and resulting artifact are trusted.

Response and remediation

  • Isolate the affected host if the process or hidden file is unauthorized.
  • Terminate malicious processes, quarantine the file, and remove related persistence only after preserving evidence.
  • Hunt for matching file and process hashes, names, paths, and related network indicators across the environment.
  • Identify and remediate the initial access vector, and rotate any credentials or secrets exposed by the compromise.
  • Restore affected system files and configuration from a trusted source and monitor for recurrence.

Related rules

to-top