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

Related rules

to-top