Dynamic Linker Creation or Modification
Detects the creation or modification of files related to the dynamic linker on Linux systems. The dynamic linker is a shared library that is used by the Linux kernel to load and execute programs. Attackers may attempt to hijack the execution flow of a program by modifying the dynamic linker configuration files.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/08/08"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2024/10/17"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects the creation or modification of files related to the dynamic linker on Linux systems. The dynamic linker is a
11shared library that is used by the Linux kernel to load and execute programs. Attackers may attempt to hijack the
12execution flow of a program by modifying the dynamic linker configuration files.
13"""
14from = "now-9m"
15index = ["logs-endpoint.events.*"]
16language = "eql"
17license = "Elastic License v2"
18name = "Dynamic Linker Creation or Modification"
19risk_score = 47
20rule_id = "640f79d1-571d-4f96-a9af-1194fc8cf763"
21setup = """## Setup
22
23This rule requires data coming in from Elastic Defend.
24
25### Elastic Defend Integration Setup
26Elastic 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.
27
28#### Prerequisite Requirements:
29- Fleet is required for Elastic Defend.
30- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
31
32#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
33- Go to the Kibana home page and click "Add integrations".
34- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
35- Click "Add Elastic Defend".
36- Configure the integration name and optionally add a description.
37- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
38- 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).
39- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
40- 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.
41For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
42- Click "Save and Continue".
43- 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.
44For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
45"""
46severity = "medium"
47tags = [
48 "Domain: Endpoint",
49 "OS: Linux",
50 "Use Case: Threat Detection",
51 "Tactic: Defense Evasion",
52 "Tactic: Persistence",
53 "Data Source: Elastic Defend",
54]
55timestamp_override = "event.ingested"
56type = "eql"
57query = '''
58file where host.os.type == "linux" and event.action in ("creation", "rename") and
59file.path : ("/etc/ld.so.preload", "/etc/ld.so.conf.d/*", "/etc/ld.so.conf") and
60not (
61 process.executable in (
62 "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
63 "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
64 "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
65 "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
66 "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
67 "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
68 "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/dev/fd/*", "/usr/bin/pamac-daemon",
69 "/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "/usr/libexec/platform-python",
70 "/usr/lib/snapd/snap-update-ns", "/usr/bin/vmware-config-tools.pl"
71 ) or
72 file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
73 file.Ext.original.extension == "dpkg-new" or
74 process.executable : (
75 "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*", "/opt/dynatrace/oneagent/*"
76 ) or
77 process.executable == null or
78 process.name == "java" or
79 (process.name == "sed" and file.name : "sed*") or
80 (process.name == "perl" and file.name : "e2scrub_all.tmp*")
81)
82'''
83
84[[rule.threat]]
85framework = "MITRE ATT&CK"
86
87[[rule.threat.technique]]
88id = "T1574"
89name = "Hijack Execution Flow"
90reference = "https://attack.mitre.org/techniques/T1574/"
91
92[[rule.threat.technique.subtechnique]]
93id = "T1574.006"
94name = "Dynamic Linker Hijacking"
95reference = "https://attack.mitre.org/techniques/T1574/006/"
96
97[rule.threat.tactic]
98id = "TA0005"
99name = "Defense Evasion"
100reference = "https://attack.mitre.org/tactics/TA0005/"
101
102[[rule.threat]]
103framework = "MITRE ATT&CK"
104
105[[rule.threat.technique]]
106id = "T1574"
107name = "Hijack Execution Flow"
108reference = "https://attack.mitre.org/techniques/T1574/"
109
110[[rule.threat.technique.subtechnique]]
111id = "T1574.006"
112name = "Dynamic Linker Hijacking"
113reference = "https://attack.mitre.org/techniques/T1574/006/"
114
115[rule.threat.tactic]
116id = "TA0003"
117name = "Persistence"
118reference = "https://attack.mitre.org/tactics/TA0003/"
Related rules
- DNF Package Manager Plugin File Creation
- Git Hook Child Process
- Git Hook Command Execution
- Git Hook Egress Network Connection
- Suspicious APT Package Manager Execution