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"
  5min_stack_comments = "Multiple field support in the New Terms rule type was added in Elastic 8.6"
  6min_stack_version = "8.6.0"
  7updated_date = "2024/02/21"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies modification of the dynamic linker preload shared object (ld.so.preload). Adversaries may execute malicious
 13payloads by hijacking the dynamic linker used to load libraries.
 14"""
 15from = "now-9m"
 16index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"]
 17language = "kuery"
 18license = "Elastic License v2"
 19name = "Modification of Dynamic Linker Preload Shared Object"
 20references = [
 21    "https://www.anomali.com/blog/rocke-evolves-its-arsenal-with-a-new-malware-family-written-in-golang",
 22]
 23risk_score = 47
 24rule_id = "717f82c2-7741-4f9b-85b8-d06aeb853f4f"
 25setup = """## Setup
 26
 27This rule requires data coming in from one of the following integrations:
 28- Elastic Defend
 29- Auditbeat
 30
 31### Elastic Defend Integration Setup
 32Elastic 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.
 33
 34#### Prerequisite Requirements:
 35- Fleet is required for Elastic Defend.
 36- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 37
 38#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 39- Go to the Kibana home page and click "Add integrations".
 40- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 41- Click "Add Elastic Defend".
 42- Configure the integration name and optionally add a description.
 43- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 44- 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).
 45- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 46- 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.
 47For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 48- Click "Save and Continue".
 49- 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.
 50For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 51
 52### Auditbeat Setup
 53Auditbeat 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.
 54
 55#### The following steps should be executed in order to add the Auditbeat on a Linux System:
 56- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
 57- 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).
 58- 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).
 59- 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).
 60- 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).
 61"""
 62severity = "medium"
 63tags = [
 64        "Domain: Endpoint",
 65        "OS: Linux",
 66        "Use Case: Threat Detection",
 67        "Tactic: Privilege Escalation",
 68        "Data Source: Elastic Endgame",
 69        "Data Source: Elastic Defend"
 70        ]
 71timestamp_override = "event.ingested"
 72type = "new_terms"
 73query = '''
 74host.os.type:linux and event.category:file and event.action:(updated or renamed or rename or file_rename_event) and 
 75not event.type:deletion and file.path:/etc/ld.so.preload and not process.name:(wine or oneagentinstallaction)
 76'''
 77
 78[[rule.threat]]
 79framework = "MITRE ATT&CK"
 80
 81[[rule.threat.technique]]
 82id = "T1574"
 83name = "Hijack Execution Flow"
 84reference = "https://attack.mitre.org/techniques/T1574/"
 85
 86[[rule.threat.technique.subtechnique]]
 87id = "T1574.006"
 88name = "Dynamic Linker Hijacking"
 89reference = "https://attack.mitre.org/techniques/T1574/006/"
 90
 91[rule.threat.tactic]
 92id = "TA0004"
 93name = "Privilege Escalation"
 94reference = "https://attack.mitre.org/tactics/TA0004/"
 95
 96[rule.new_terms]
 97field = "new_terms_fields"
 98value = ["host.id", "user.id", "process.executable"]
 99
100[[rule.new_terms.history_window_start]]
101field = "history_window_start"
102value = "now-10d"

References

Related rules

to-top