<?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/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Unshare - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/unshare/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 09 Jan 2024 18:23:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/unshare/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>Potential Privilege Escalation via unshare and UID Change</title><link>https://feed.craftedsignal.io/briefs/2024-01-09-unshare-privesc/</link><pubDate>Tue, 09 Jan 2024 18:23:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-09-unshare-privesc/</guid><description>This rule detects potential privilege escalation attempts on Linux systems by identifying suspicious use of the `unshare` command to create user namespaces followed by a UID change to root, indicative of local privilege escalation.</description><content:encoded><![CDATA[<p>This detection rule identifies potential privilege escalation attempts on Linux systems by monitoring the use of the <code>unshare</code> command and subsequent UID changes to root. The <code>unshare</code> command is used to create new namespaces, including user namespaces, which can be leveraged in exploit chains. Attackers may use <code>unshare</code> with user namespace flags as a preliminary step before escalating privileges to root. This behavior can indicate successful exploitation of vulnerabilities, such as those related to OverlayFS, or other local privilege escalation techniques. This detection is intentionally generic to surface multiple local privilege escalation patterns beyond a single CVE. The rule focuses on detecting a sequence of events where a non-root user executes <code>unshare</code> with user-namespace related arguments followed by a UID change event indicating the user has become root.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A non-root user executes the <code>unshare</code> command with arguments indicating the creation of a new user namespace (e.g., <code>-U</code>, <code>--user</code>, <code>-r</code>, <code>-rm</code>, <code>m</code>).</li>
<li>The <code>unshare</code> command creates a new user namespace context for the process.</li>
<li>Within the newly created namespace, the attacker attempts to change the user ID (UID) to 0 (root).</li>
<li>The system logs a <code>uid_change</code> event, indicating that the user's UID has been changed to 0 within the namespace.</li>
<li>The attacker executes further commands as root within the new namespace.</li>
<li>These commands may involve exploiting vulnerabilities, modifying system files, or installing malicious software.</li>
<li>The attacker may attempt to escape the namespace to gain root privileges on the host system.</li>
<li>The final objective is to gain persistent root access to the system, allowing for complete control and potential data exfiltration or system compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to complete system compromise, allowing the attacker to perform any action with root privileges. This can result in data theft, system disruption, or the installation of backdoors for persistent access. The number of victims can vary depending on the scope of the attack, but even a single successful privilege escalation can have severe consequences. Targeted sectors are broad, including any Linux-based system where unprivileged users have access to the <code>unshare</code> command, such as cloud workloads and traditional endpoints.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the provided Sigma rule to your SIEM to detect suspicious <code>unshare</code> usage followed by UID changes (<code>Potential Privilege Escalation via unshare and UID Change</code>).</li>
<li>Investigate any detected instances of <code>unshare</code> usage with user namespace arguments and subsequent UID changes to root, as described in the rule description.</li>
<li>Review and restrict the use of <code>unshare</code> and user namespaces if not required in your environment to mitigate the risk of privilege escalation.</li>
<li>Enable Elastic Defend integration to collect the necessary process and event data required for the Sigma rule to function effectively (Elastic Defend integration).</li>
<li>Monitor process execution for commands run after the <code>uid_change</code> event to identify potentially malicious activities.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>privilege-escalation</category><category>linux</category><category>unshare</category><category>namespace</category></item></channel></rss>