Skip to content

Commit bb38e25

Browse files
authored
[New Rule] Privilege Escalation via SUID/SGID Proxy Execution (#5266)
* [New Rule] Privilege Escalation via SUID/SGID Proxy Execution * Update privilege_escalation_potential_suid_sgid_proxy_execution.toml * Update rules/linux/privilege_escalation_potential_suid_sgid_proxy_execution.toml
1 parent 62d7316 commit bb38e25

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
[metadata]
2+
creation_date = "2025/10/30"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/10/30"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Detects potential privilege escalation via SUID/SGID proxy execution on Linux systems. Attackers may exploit binaries with the
11+
SUID/SGID bit set to execute commands with elevated privileges. This rule identifies instances where a process is executed with
12+
root privileges (user ID 0 or group ID 0) while the real user or group ID is non-root, indicating potential misuse of SUID/SGID
13+
binaries.
14+
"""
15+
from = "now-9m"
16+
index = ["logs-endpoint.events.process*"]
17+
language = "eql"
18+
license = "Elastic License v2"
19+
name = "Potential Privilege Escalation via SUID/SGID Proxy Execution"
20+
references = [
21+
"https://dfir.ch/posts/today_i_learned_binfmt_misc/",
22+
"https://gtfobins.github.io/#+suid",
23+
"https://www.elastic.co/security-labs/primer-on-persistence-mechanisms",
24+
]
25+
risk_score = 21
26+
rule_id = "341c6e18-9ef1-437e-bf18-b513f3ae2130"
27+
setup = """## Setup
28+
29+
This rule requires data coming in from Elastic Defend.
30+
31+
### Elastic Defend Integration Setup
32+
Elastic 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.
47+
For 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.
50+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
51+
"""
52+
severity = "low"
53+
tags = [
54+
"Domain: Endpoint",
55+
"OS: Linux",
56+
"Use Case: Threat Detection",
57+
"Tactic: Privilege Escalation",
58+
"Tactic: Persistence",
59+
"Tactic: Defense Evasion",
60+
"Data Source: Elastic Defend",
61+
]
62+
timestamp_override = "event.ingested"
63+
type = "eql"
64+
query = '''
65+
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
66+
(process.user.id == "0" and process.real_user.id != "0") or
67+
(process.group.id == "0" and process.real_group.id != "0")
68+
) and process.args in (
69+
"/bin/su", "/usr/bin/su",
70+
"/usr/bin/sudo",
71+
"/bin/mount", "/usr/bin/mount",
72+
"/bin/umount", "/usr/bin/umount",
73+
"/usr/bin/fusermount3",
74+
"/bin/passwd", "/usr/bin/passwd",
75+
"/bin/chfn", "/usr/bin/chfn",
76+
"/bin/chsh", "/usr/bin/chsh",
77+
"/bin/gpasswd", "/usr/bin/gpasswd",
78+
"/bin/newgrp", "/usr/bin/newgrp",
79+
"/sbin/unix_chkpwd", "/usr/sbin/unix_chkpwd",
80+
"/usr/bin/newuidmap", "/usr/bin/newgidmap",
81+
"/usr/lib/dbus-1.0/dbus-daemon-launch-helper", "/usr/libexec/dbus-daemon-launch-helper",
82+
"/usr/lib/openssh/ssh-keysign", "/usr/libexec/openssh/ssh-keysign",
83+
"/usr/bin/pkexec", "/usr/libexec/pkexec", "/usr/lib/polkit-1/pkexec",
84+
"/usr/lib/polkit-1/polkit-agent-helper-1", "/usr/libexec/polkit-agent-helper-1",
85+
"/usr/lib/snapd/snap-confine"
86+
) and process.parent.args_count == 1
87+
'''
88+
89+
[[rule.threat]]
90+
framework = "MITRE ATT&CK"
91+
92+
[[rule.threat.technique]]
93+
id = "T1068"
94+
name = "Exploitation for Privilege Escalation"
95+
reference = "https://attack.mitre.org/techniques/T1068/"
96+
97+
[[rule.threat.technique]]
98+
id = "T1548"
99+
name = "Abuse Elevation Control Mechanism"
100+
reference = "https://attack.mitre.org/techniques/T1548/"
101+
102+
[[rule.threat.technique.subtechnique]]
103+
id = "T1548.001"
104+
name = "Setuid and Setgid"
105+
reference = "https://attack.mitre.org/techniques/T1548/001/"
106+
107+
[rule.threat.tactic]
108+
id = "TA0004"
109+
name = "Privilege Escalation"
110+
reference = "https://attack.mitre.org/tactics/TA0004/"
111+
112+
[[rule.threat]]
113+
framework = "MITRE ATT&CK"
114+
115+
[rule.threat.tactic]
116+
id = "TA0003"
117+
name = "Persistence"
118+
reference = "https://attack.mitre.org/tactics/TA0003/"
119+
120+
[[rule.threat]]
121+
framework = "MITRE ATT&CK"
122+
123+
[rule.threat.tactic]
124+
name = "Defense Evasion"
125+
id = "TA0005"
126+
reference = "https://attack.mitre.org/tactics/TA0005/"
127+
128+
[[rule.threat.technique]]
129+
id = "T1218"
130+
name = "System Binary Proxy Execution"
131+
reference = "https://attack.mitre.org/techniques/T1218/"

0 commit comments

Comments
 (0)