<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Suid — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/suid/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Sat, 02 Nov 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/suid/feed.xml" rel="self" type="application/rss+xml"/><item><title>Potential Privilege Escalation via SUID/SGID on Linux</title><link>https://feed.craftedsignal.io/briefs/2024-11-suid-sgid-privilege-escalation/</link><pubDate>Sat, 02 Nov 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-11-suid-sgid-privilege-escalation/</guid><description>Attackers may leverage misconfigured SUID/SGID permissions on Linux systems to escalate privileges to root or establish persistence by executing processes with root privileges initiated by non-root users.</description><content:encoded><![CDATA[<p>The SUID (Set User ID) and SGID (Set Group ID) bits are file permission mechanisms in Unix-like operating systems that allow a program to be executed with the privileges of the file&rsquo;s owner or group, respectively. While intended for legitimate purposes, such as allowing users to perform specific administrative tasks, they can be abused by attackers to escalate privileges. Attackers can exploit misconfigured SUID/SGID binaries to gain elevated access or persistence. This detection focuses on identifying processes running with root privileges (UID/GID 0) but initiated by non-root users, flagging potential misuse of SUID/SGID permissions on Linux systems monitored by Elastic Defend. This can indicate an attacker attempting to exploit a misconfiguration in order to escalate their privileges to root, or establish a backdoor for persistence.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Linux system via some vulnerability or compromised credentials.</li>
<li>The attacker identifies binaries with SUID/SGID bits set.</li>
<li>The attacker executes a vulnerable SUID/SGID binary, such as <code>find</code> or <code>nmap</code>.</li>
<li>The binary executes with root privileges, even though the attacker is a non-root user.</li>
<li>The attacker leverages the elevated privileges to read sensitive files, modify system configurations, or install malicious software.</li>
<li>The attacker escalates privileges to root.</li>
<li>The attacker establishes persistence by creating a new SUID/SGID binary or modifying an existing one.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of SUID/SGID misconfigurations can lead to complete system compromise, as attackers gain root privileges. Attackers can install malware, steal sensitive data, or disrupt critical services. The impact can range from data breaches to denial-of-service attacks. Given the broad range of binaries potentially affected, this vulnerability can impact various sectors and potentially affect a large number of Linux systems.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule <code>Privilege Escalation via SUID/SGID</code> to your SIEM to detect potential privilege escalation attempts.</li>
<li>Enable Elastic Defend integration to ensure the necessary process execution data is available.</li>
<li>Regularly audit SUID/SGID permissions across your Linux systems and remove unnecessary SUID/SGID bits.</li>
<li>Investigate any alerts generated by the Sigma rule by checking <code>process.real_user.id</code> and <code>process.real_group.id</code> to determine if non-root users initiated the process.</li>
<li>Review the process details, including <code>process.name</code> and <code>process.args</code>, to understand the nature of the executed command and its intended function.</li>
<li>Monitor system logs for suspicious activity around the time of the alert to identify any related actions.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>privilege-escalation</category><category>persistence</category><category>defense-evasion</category><category>suid</category><category>sgid</category></item><item><title>Potential Privilege Escalation via SUID/SGID Abuse on Linux</title><link>https://feed.craftedsignal.io/briefs/2024-01-suid-sgid-privesc/</link><pubDate>Wed, 24 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-suid-sgid-privesc/</guid><description>This rule detects potential privilege escalation attempts on Linux systems by identifying processes running with root privileges but initiated by non-root users, indicative of SUID/SGID abuse.</description><content:encoded><![CDATA[<p>This detection rule, sourced from Elastic, identifies instances where a process executes with root privileges (UID/GID 0) while the real user/group ID is non-zero. This condition suggests that the process has been granted SUID/SGID permissions, potentially allowing it to run with elevated privileges. Attackers may exploit such misconfigurations to escalate their privileges to root or establish persistence mechanisms. The rule focuses on Linux systems and leverages Elastic Defend data to identify such events. The initial publication date of the rule was in June 2024, with updates made as recently as May 2026. This type of misconfiguration can lead to significant security breaches.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A user (non-root) executes a binary that has the SUID or SGID bit set.</li>
<li>The system checks the permissions of the executable and identifies the SUID/SGID bit.</li>
<li>The process spawns with the effective UID/GID set to the owner/group of the executable file (typically root).</li>
<li>The process attempts to perform actions that require elevated privileges.</li>
<li>If the SUID/SGID binary is vulnerable, the attacker can leverage it to execute arbitrary commands as root.</li>
<li>The attacker escalates privileges to root, gaining full control over the system.</li>
<li>The attacker installs a backdoor for persistent access.</li>
<li>The attacker performs malicious activities, such as data exfiltration or system compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of SUID/SGID misconfigurations can grant an attacker root-level access to a Linux system. This can lead to complete system compromise, including data theft, installation of malware, and the potential for lateral movement to other systems on the network. A single compromised system can be leveraged to attack other internal assets.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect potential SUID/SGID exploitation (see the <code>rules</code> section).</li>
<li>Review the SUID/SGID binaries identified by the rule and verify their configurations to ensure they are correctly set and necessary.</li>
<li>Implement enhanced monitoring and logging for SUID/SGID execution attempts to detect and respond to similar threats in the future (Data Source: Elastic Defend).</li>
<li>Consider implementing stricter access controls and reducing the number of SUID/SGID binaries on the system to minimize the attack surface.</li>
<li>Investigate the parent process of the flagged binaries to determine the origin of the execution and whether it aligns with expected behavior.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>privilege-escalation</category><category>persistence</category><category>suid</category><category>sgid</category></item><item><title>Suspicious SUID Binary Execution on Linux</title><link>https://feed.craftedsignal.io/briefs/2024-01-suspicious-suid-execution/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-suspicious-suid-execution/</guid><description>This rule detects the execution of privilege escalation helpers under the root effective user, when initiated by a non-root user with a suspicious parent process, indicating potential privilege escalation attempts.</description><content:encoded><![CDATA[<p>This detection rule identifies suspicious executions of common privilege elevation tools on Linux systems. It focuses on instances where binaries like <code>su</code>, <code>sudo</code>, <code>pkexec</code>, <code>passwd</code>, <code>chsh</code>, and <code>newgrp</code> are executed with root privileges but are initiated by a non-root user. The rule further refines its focus by analyzing the parent process context, specifically looking for interpreters (Python, Perl, Ruby, etc.), commands executed from user-writable directories (/tmp, /var/tmp, /dev/shm, /home, /run/user), or short shell command invocations. The detection is designed to uncover potential privilege escalation attempts that may be indicative of malicious activity. This is important because attackers frequently use SUID binaries to elevate privileges, and detecting unusual usage patterns can help identify compromised systems or insider threats.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A non-privileged user gains initial access to the system, potentially through compromised credentials or exploiting a vulnerability.</li>
<li>The attacker navigates to a user-writable directory such as <code>/tmp</code> or <code>/home/&lt;user&gt;</code>.</li>
<li>The attacker crafts a malicious script or uses a one-liner command to invoke a SUID binary.</li>
<li>The SUID binary (e.g., <code>sudo</code>, <code>pkexec</code>, <code>su</code>) is executed with minimal arguments.</li>
<li>The system executes the command with root privileges due to the SUID bit being set on the binary.</li>
<li>The attacker leverages the elevated privileges to modify system files, install malicious software, or create new administrative accounts.</li>
<li>The attacker establishes persistence to maintain access to the compromised system.</li>
<li>The attacker achieves their final objective, which could include data exfiltration, system disruption, or further lateral movement within the network.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of SUID binaries can lead to full system compromise. An attacker can gain complete control over the affected Linux system, potentially leading to data breaches, service disruptions, and the installation of persistent malware. This can affect critical infrastructure and sensitive data, causing significant financial and reputational damage. The severity is amplified when multiple systems are compromised, allowing for lateral movement and further exploitation within the network.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable process creation logging and ensure that <code>process.user.id</code>, <code>process.real_user.id</code>, and <code>process.parent.user.id</code> are being captured to activate the rules below.</li>
<li>Deploy the &ldquo;Suspicious SUID Binary Execution&rdquo; Sigma rule to your SIEM and tune for your environment.</li>
<li>Review authentication and sudoers policies to identify and remediate any misconfigurations.</li>
<li>Investigate any alerts generated by the Sigma rules to determine the legitimacy of the SUID binary execution and the parent process context.</li>
<li>Implement file integrity monitoring on sensitive system binaries and directories, particularly those related to privilege escalation, to detect unauthorized modifications.</li>
<li>Restrict the use of SUID binaries where possible and enforce strict permissions on those that are necessary.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>privilege-escalation</category><category>suid</category><category>linux</category></item></channel></rss>