Modification of Dynamic Linker Preload Shared Object
Identifies modification of the dynamic linker preload shared object (ld.so.preload). Adversaries may execute malicious payloads by hijacking the dynamic linker used to load libraries.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/01/27"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2025/12/23"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies modification of the dynamic linker preload shared object (ld.so.preload). Adversaries may execute malicious
11payloads by hijacking the dynamic linker used to load libraries.
12"""
13from = "now-9m"
14index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"]
15language = "kuery"
16license = "Elastic License v2"
17name = "Modification of Dynamic Linker Preload Shared Object"
18note = """## Triage and analysis
19
20> **Disclaimer**:
21> 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.
22
23### Investigating Modification of Dynamic Linker Preload Shared Object
24
25The dynamic linker preload mechanism in Linux, via `/etc/ld.so.preload`, allows preloading of shared libraries, influencing how executables load dependencies. Adversaries exploit this by inserting malicious libraries, hijacking execution flow for privilege escalation. The detection rule monitors changes to this file, excluding benign processes, to identify unauthorized modifications indicative of such abuse.
26
27### Possible investigation steps
28
29- Review the alert details to confirm the file path involved is /etc/ld.so.preload and verify the event action is one of the specified actions: updated, renamed, or file_rename_event.
30- Identify the process responsible for the modification by examining the process.name field, ensuring it is not one of the excluded processes (wine or oneagentinstallaction).
31- Investigate the process that triggered the alert by gathering additional context such as process ID, command line arguments, and parent process to understand its origin and purpose.
32- Check the modification timestamp and correlate it with other system events or logs to identify any suspicious activity or patterns around the time of the modification.
33- Analyze the contents of /etc/ld.so.preload to determine if any unauthorized or suspicious libraries have been added, and assess their potential impact on the system.
34- Review user accounts and permissions associated with the process to determine if there has been any unauthorized access or privilege escalation attempt.
35- If malicious activity is confirmed, isolate the affected system and follow incident response procedures to mitigate the threat and prevent further exploitation.
36
37### False positive analysis
38
39- Legitimate software installations or updates may modify /etc/ld.so.preload. To handle this, monitor the process names associated with these activities and consider adding them to the exclusion list if they are verified as benign.
40- System management tools like configuration management software might update /etc/ld.so.preload as part of routine operations. Identify these tools and exclude their process names from the detection rule to prevent false alerts.
41- Custom scripts or administrative tasks executed by trusted users could inadvertently trigger the rule. Review these scripts and, if necessary, exclude their process names or user accounts from the detection criteria.
42- Security agents or monitoring tools that interact with system files might cause false positives. Verify these tools' activities and exclude their process names if they are known to be safe and necessary for system operations.
43
44### Response and remediation
45
46- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement by the adversary.
47- Terminate any suspicious processes that are not part of the baseline or known benign applications, especially those related to the modification of `/etc/ld.so.preload`.
48- Restore the `/etc/ld.so.preload` file from a known good backup to ensure no malicious libraries are preloaded.
49- Conduct a thorough review of recent system changes and installed packages to identify any unauthorized software or modifications that may have facilitated the attack.
50- Escalate the incident to the security operations team for a deeper forensic analysis to determine the scope of the compromise and identify any additional affected systems.
51- Implement additional monitoring on the affected system and similar environments to detect any further attempts to modify the dynamic linker preload file.
52- Review and enhance access controls and permissions on critical system files like `/etc/ld.so.preload` to prevent unauthorized modifications in the future."""
53references = [
54 "https://www.anomali.com/blog/rocke-evolves-its-arsenal-with-a-new-malware-family-written-in-golang",
55]
56risk_score = 47
57rule_id = "717f82c2-7741-4f9b-85b8-d06aeb853f4f"
58setup = """## Setup
59
60This rule requires data coming in from one of the following integrations:
61- Elastic Defend
62- Auditbeat
63
64### Elastic Defend Integration Setup
65Elastic 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.
66
67#### Prerequisite Requirements:
68- Fleet is required for Elastic Defend.
69- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
70
71#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
72- Go to the Kibana home page and click "Add integrations".
73- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
74- Click "Add Elastic Defend".
75- Configure the integration name and optionally add a description.
76- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
77- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
78- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
79- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
80For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
81- Click "Save and Continue".
82- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
83For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
84
85### Auditbeat Setup
86Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
87
88#### The following steps should be executed in order to add the Auditbeat on a Linux System:
89- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
90- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
91- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
92- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
93- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
94"""
95severity = "medium"
96tags = [
97 "Domain: Endpoint",
98 "OS: Linux",
99 "Use Case: Threat Detection",
100 "Tactic: Privilege Escalation",
101 "Data Source: Elastic Endgame",
102 "Data Source: Elastic Defend",
103 "Resources: Investigation Guide",
104]
105timestamp_override = "event.ingested"
106type = "new_terms"
107
108query = '''
109host.os.type:linux and event.category:file and event.action:(file_rename_event or rename or renamed or updated) and
110not event.type:deletion and file.path:/etc/ld.so.preload and
111process.name:(* and not (oneagentinstallaction or passwd or wine))
112'''
113
114[[rule.threat]]
115framework = "MITRE ATT&CK"
116
117[[rule.threat.technique]]
118id = "T1574"
119name = "Hijack Execution Flow"
120reference = "https://attack.mitre.org/techniques/T1574/"
121
122[[rule.threat.technique.subtechnique]]
123id = "T1574.006"
124name = "Dynamic Linker Hijacking"
125reference = "https://attack.mitre.org/techniques/T1574/006/"
126
127[rule.threat.tactic]
128id = "TA0004"
129name = "Privilege Escalation"
130reference = "https://attack.mitre.org/tactics/TA0004/"
131
132[rule.new_terms]
133field = "new_terms_fields"
134value = ["agent.id"]
135
136[[rule.new_terms.history_window_start]]
137field = "history_window_start"
138value = "now-5d"
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 Modification of Dynamic Linker Preload Shared Object
The dynamic linker preload mechanism in Linux, via /etc/ld.so.preload, allows preloading of shared libraries, influencing how executables load dependencies. Adversaries exploit this by inserting malicious libraries, hijacking execution flow for privilege escalation. The detection rule monitors changes to this file, excluding benign processes, to identify unauthorized modifications indicative of such abuse.
Possible investigation steps
- Review the alert details to confirm the file path involved is /etc/ld.so.preload and verify the event action is one of the specified actions: updated, renamed, or file_rename_event.
- Identify the process responsible for the modification by examining the process.name field, ensuring it is not one of the excluded processes (wine or oneagentinstallaction).
- Investigate the process that triggered the alert by gathering additional context such as process ID, command line arguments, and parent process to understand its origin and purpose.
- Check the modification timestamp and correlate it with other system events or logs to identify any suspicious activity or patterns around the time of the modification.
- Analyze the contents of /etc/ld.so.preload to determine if any unauthorized or suspicious libraries have been added, and assess their potential impact on the system.
- Review user accounts and permissions associated with the process to determine if there has been any unauthorized access or privilege escalation attempt.
- If malicious activity is confirmed, isolate the affected system and follow incident response procedures to mitigate the threat and prevent further exploitation.
False positive analysis
- Legitimate software installations or updates may modify /etc/ld.so.preload. To handle this, monitor the process names associated with these activities and consider adding them to the exclusion list if they are verified as benign.
- System management tools like configuration management software might update /etc/ld.so.preload as part of routine operations. Identify these tools and exclude their process names from the detection rule to prevent false alerts.
- Custom scripts or administrative tasks executed by trusted users could inadvertently trigger the rule. Review these scripts and, if necessary, exclude their process names or user accounts from the detection criteria.
- Security agents or monitoring tools that interact with system files might cause false positives. Verify these tools' activities and exclude their process names if they are known to be safe and necessary for system operations.
Response and remediation
- Immediately isolate the affected system from the network to prevent further exploitation or lateral movement by the adversary.
- Terminate any suspicious processes that are not part of the baseline or known benign applications, especially those related to the modification of
/etc/ld.so.preload. - Restore the
/etc/ld.so.preloadfile from a known good backup to ensure no malicious libraries are preloaded. - Conduct a thorough review of recent system changes and installed packages to identify any unauthorized software or modifications that may have facilitated the attack.
- Escalate the incident to the security operations team for a deeper forensic analysis to determine the scope of the compromise and identify any additional affected systems.
- Implement additional monitoring on the affected system and similar environments to detect any further attempts to modify the dynamic linker preload file.
- Review and enhance access controls and permissions on critical system files like
/etc/ld.so.preloadto prevent unauthorized modifications in the future.
References
Related rules
- Deprecated - Network Connection via Sudo Binary
- Deprecated - Potential Privilege Escalation via UID INT_MAX Bug Detected
- Kernel Load or Unload via Kexec Detected
- Namespace Manipulation Using Unshare
- Potential CVE-2025-32463 Nsswitch File Creation