Suspicious Symbolic Link Created

Identifies the creation of a symbolic link to a suspicious file or location. A symbolic link is a reference to a file or directory that acts as a pointer or shortcut, allowing users to access the target file or directory from a different location in the file system. An attacker can potentially leverage symbolic links for privilege escalation by tricking a privileged process into following the symbolic link to a sensitive file, giving the attacker access to data or capabilities they would not normally have.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2023/07/27"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2024/07/30"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies the creation of a symbolic link to a suspicious file or location. A symbolic link is a reference to a file or
 11directory that acts as a pointer or shortcut, allowing users to access the target file or directory from a different
 12location in the file system. An attacker can potentially leverage symbolic links for privilege escalation by tricking a
 13privileged process into following the symbolic link to a sensitive file, giving the attacker access to data or
 14capabilities they would not normally have.
 15"""
 16from = "now-9m"
 17index = ["logs-endpoint.events.*"]
 18language = "eql"
 19license = "Elastic License v2"
 20name = "Suspicious Symbolic Link Created"
 21risk_score = 21
 22rule_id = "8a024633-c444-45c0-a4fe-78128d8c1ab6"
 23setup = """## Setup
 24
 25This rule requires data coming in from Elastic Defend.
 26
 27### Elastic Defend Integration Setup
 28Elastic 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.
 29
 30#### Prerequisite Requirements:
 31- Fleet is required for Elastic Defend.
 32- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 33
 34#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 35- Go to the Kibana home page and click "Add integrations".
 36- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 37- Click "Add Elastic Defend".
 38- Configure the integration name and optionally add a description.
 39- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 40- 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).
 41- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 42- 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.
 43For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 44- Click "Save and Continue".
 45- 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.
 46For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 47"""
 48severity = "low"
 49tags = [
 50    "Domain: Endpoint",
 51    "OS: Linux",
 52    "Use Case: Threat Detection",
 53    "Tactic: Privilege Escalation",
 54    "Tactic: Credential Access",
 55    "Data Source: Elastic Defend",
 56]
 57timestamp_override = "event.ingested"
 58type = "eql"
 59query = '''
 60process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
 61process.name == "ln" and process.args in ("-s", "-sf") and 
 62  (
 63    /* suspicious files */
 64    (process.args in ("/etc/shadow", "/etc/shadow-", "/etc/shadow~", "/etc/gshadow", "/etc/gshadow-") or 
 65    (process.working_directory == "/etc" and process.args in ("shadow", "shadow-", "shadow~", "gshadow", "gshadow-"))) or 
 66    
 67    /* suspicious bins */
 68    (process.args in ("/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh", "/bin/csh", "/bin/zsh", "/bin/ksh", "/bin/fish") or 
 69    (process.working_directory == "/bin" and process.args : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"))) or 
 70    (process.args in ("/usr/bin/bash", "/usr/bin/dash", "/usr/bin/sh", "/usr/bin/tcsh", "/usr/bin/csh", "/usr/bin/zsh", "/usr/bin/ksh", "/usr/bin/fish") or 
 71    (process.working_directory == "/usr/bin" and process.args in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"))) or
 72    
 73    /* suspicious locations */
 74    (process.args : ("/etc/cron.d/*", "/etc/cron.daily/*", "/etc/cron.hourly/*", "/etc/cron.weekly/*", "/etc/cron.monthly/*")) or
 75    (process.args : ("/home/*/.ssh/*", "/root/.ssh/*","/etc/sudoers.d/*", "/dev/shm/*"))
 76  ) and 
 77  process.parent.name in ("bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and 
 78  not user.Ext.real.id == "0" and not group.Ext.real.id == "0"
 79'''
 80
 81[[rule.threat]]
 82framework = "MITRE ATT&CK"
 83
 84[[rule.threat.technique]]
 85id = "T1548"
 86name = "Abuse Elevation Control Mechanism"
 87reference = "https://attack.mitre.org/techniques/T1548/"
 88
 89[rule.threat.tactic]
 90id = "TA0004"
 91name = "Privilege Escalation"
 92reference = "https://attack.mitre.org/tactics/TA0004/"
 93
 94[[rule.threat]]
 95framework = "MITRE ATT&CK"
 96
 97[[rule.threat.technique]]
 98id = "T1003"
 99name = "OS Credential Dumping"
100reference = "https://attack.mitre.org/techniques/T1003/"
101
102[[rule.threat.technique.subtechnique]]
103id = "T1003.008"
104name = "/etc/passwd and /etc/shadow"
105reference = "https://attack.mitre.org/techniques/T1003/008/"
106
107[rule.threat.tactic]
108id = "TA0006"
109name = "Credential Access"
110reference = "https://attack.mitre.org/tactics/TA0006/"

Related rules

to-top