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/08/08"
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 ) or
71 file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
72 file.Ext.original.extension == "dpkg-new" or
73 process.executable : (
74 "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*"
75 ) or
76 process.executable == null or
77 (process.name == "sed" and file.name : "sed*") or
78 (process.name == "perl" and file.name : "e2scrub_all.tmp*")
79)
80'''
81
82[[rule.threat]]
83framework = "MITRE ATT&CK"
84
85[[rule.threat.technique]]
86id = "T1574"
87name = "Hijack Execution Flow"
88reference = "https://attack.mitre.org/techniques/T1574/"
89
90[[rule.threat.technique.subtechnique]]
91id = "T1574.006"
92name = "Dynamic Linker Hijacking"
93reference = "https://attack.mitre.org/techniques/T1574/006/"
94
95[rule.threat.tactic]
96id = "TA0005"
97name = "Defense Evasion"
98reference = "https://attack.mitre.org/tactics/TA0005/"
99
100[[rule.threat]]
101framework = "MITRE ATT&CK"
102
103[[rule.threat.technique]]
104id = "T1574"
105name = "Hijack Execution Flow"
106reference = "https://attack.mitre.org/techniques/T1574/"
107
108[[rule.threat.technique.subtechnique]]
109id = "T1574.006"
110name = "Dynamic Linker Hijacking"
111reference = "https://attack.mitre.org/techniques/T1574/006/"
112
113[rule.threat.tactic]
114id = "TA0003"
115name = "Persistence"
116reference = "https://attack.mitre.org/tactics/TA0003/"
Related rules
- Suspicious APT Package Manager Network Connection
- Suspicious File Creation via Kworker
- Git Hook Command Execution
- Git Hook Egress Network Connection
- APT Package Manager Configuration File Creation