Skip to content

Commit 1fbd6b7

Browse files
Aegrahgithub-actions[bot]
authored andcommitted
[New Rule] Suspicious Symbolic Link Created (#2969)
* [New Rule] Suspicious Symbolic Link Created * Update rules/linux/privilege_escalation_linux_suspicious_symbolic_link.toml Co-authored-by: Justin Ibarra <[email protected]> * fixed unit testing issues after suggestion commit --------- Co-authored-by: Justin Ibarra <[email protected]> Co-authored-by: Colson Wilhoit <[email protected]> (cherry picked from commit c6eba3e)
1 parent b6b1ff9 commit 1fbd6b7

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[metadata]
2+
creation_date = "2023/07/27"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6+
min_stack_version = "8.3.0"
7+
updated_date = "2023/07/27"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Identifies the creation of a symbolic link to a suspicious file or location. A symbolic link is a reference to a file or
13+
directory that acts as a pointer or shortcut, allowing users to access the target file or directory from a different
14+
location in the file system. An attacker can potentially leverage symbolic links for privilege escalation by tricking a
15+
privileged process into following the symbolic link to a sensitive file, giving the attacker access to data or
16+
capabilities they would not normally have.
17+
"""
18+
from = "now-9m"
19+
index = ["logs-endpoint.events.*", "endgame-*"]
20+
language = "eql"
21+
license = "Elastic License v2"
22+
name = "Suspicious Symbolic Link Created"
23+
risk_score = 21
24+
rule_id = "8a024633-c444-45c0-a4fe-78128d8c1ab6"
25+
severity = "low"
26+
tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Tactic: Credential Access", "Data Source: Elastic Endgame"]
27+
timestamp_override = "event.ingested"
28+
type = "eql"
29+
query = '''
30+
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and
31+
event.type == "start" and process.name == "ln" and
32+
(
33+
/* suspicious files */
34+
(process.args in ("/etc/shadow", "/etc/shadow-", "/etc/shadow~", "/etc/gshadow", "/etc/gshadow-") or
35+
(process.working_directory == "/etc" and process.args in ("shadow", "shadow-", "shadow~", "gshadow", "gshadow-"))) or
36+
37+
/* suspicious bins */
38+
(process.args in ("/bin/bash", "/bin/dash", "/bin/sh", "/bin/tcsh", "/bin/csh", "/bin/zsh", "/bin/ksh", "/bin/fish") or
39+
(process.working_directory == "/bin" and process.args : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"))) or
40+
(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
41+
(process.working_directory == "/usr/bin" and process.args in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"))) or
42+
43+
/* suspicious locations */
44+
(process.args : ("/etc/cron.d/*", "/etc/cron.daily/*", "/etc/cron.hourly/*", "/etc/cron.weekly/*", "/etc/cron.monthly/*")) or
45+
(process.args : ("/home/*/.ssh/*", "/root/.ssh/*","/etc/sudoers.d/*", "/dev/shm/*"))
46+
) and
47+
not user.Ext.real.id == "0" and not group.Ext.real.id == "0"
48+
'''
49+
50+
[[rule.threat]]
51+
framework = "MITRE ATT&CK"
52+
53+
[[rule.threat.technique]]
54+
id = "T1548"
55+
name = "Abuse Elevation Control Mechanism"
56+
reference = "https://attack.mitre.org/techniques/T1548/"
57+
58+
[rule.threat.tactic]
59+
id = "TA0004"
60+
name = "Privilege Escalation"
61+
reference = "https://attack.mitre.org/tactics/TA0004/"
62+
63+
[[rule.threat]]
64+
framework = "MITRE ATT&CK"
65+
66+
[[rule.threat.technique]]
67+
id = "T1003"
68+
name = "OS Credential Dumping"
69+
reference = "https://attack.mitre.org/techniques/T1003/"
70+
71+
[[rule.threat.technique.subtechnique]]
72+
id = "T1003.008"
73+
name = "/etc/passwd and /etc/shadow"
74+
reference = "https://attack.mitre.org/techniques/T1003/008/"
75+
76+
[rule.threat.tactic]
77+
id = "TA0006"
78+
name = "Credential Access"
79+
reference = "https://attack.mitre.org/tactics/TA0006/"

0 commit comments

Comments
 (0)