<?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>Tabexpansion — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/tabexpansion/</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>Wed, 03 Jan 2024 17:21:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/tabexpansion/feed.xml" rel="self" type="application/rss+xml"/><item><title>Suspicious PowerShell TabExpansion Direct Call</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-powershell-tabexpansion/</link><pubDate>Wed, 03 Jan 2024 17:21:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-powershell-tabexpansion/</guid><description>This detection identifies PowerShell scripts that directly call the TabExpansion internal function, which is uncommon and may indicate malicious activity, such as TabShell, potentially bypassing sandboxes by loading PowerShell functions via directory traversal.</description><content:encoded><![CDATA[<p>This alert detects specific indicators associated with the execution of the <code>TabExpansion</code> internal function in PowerShell. Direct calls to this function are not normal and can be indicative of malicious activity such as TabShell. This technique can bypass PowerShell&rsquo;s restricted language mode. By exploiting PowerShell internals, attackers can use directory traversal in conjunction with the <code>TabExpansion</code> function to load arbitrary PowerShell functions, even within a sandboxed environment. While legitimate use of <code>TabExpansion</code> is rare, it&rsquo;s crucial for defenders to understand that direct calls to this function can be a sign of malicious activity attempting to circumvent security restrictions within PowerShell.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to the system. This step is not specified in the source, but is a prerequisite.</li>
<li>The attacker executes a PowerShell script.</li>
<li>The PowerShell script directly calls the <code>TabExpansion</code> internal function.</li>
<li>The <code>TabExpansion</code> function, when called directly, attempts to resolve paths or commands based on partial input.</li>
<li>The attacker crafts a malicious payload, using directory traversal to point to a malicious PowerShell script location.</li>
<li>The <code>TabExpansion</code> function resolves the crafted path, effectively bypassing intended restrictions.</li>
<li>The malicious PowerShell script is loaded and executed within the current PowerShell session, even if sandboxed.</li>
<li>The attacker achieves arbitrary code execution and potentially escalates privileges.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can allow an attacker to bypass PowerShell&rsquo;s security restrictions, including constrained language mode. This could lead to arbitrary code execution, privilege escalation, and potentially complete system compromise. The impact is significant, as it allows malicious actors to execute code within an environment that is supposed to be restricted and secure.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell Script Block Logging (Event ID 4104) to capture the necessary telemetry to detect this activity.</li>
<li>Deploy the Sigma rule <code>Suspicious PowerShell TabExpansion Call</code> to your SIEM and tune for your environment to reduce false positives.</li>
<li>Investigate any alerts generated by the <code>Suspicious PowerShell TabExpansion Call</code> rule to determine if the activity is legitimate or malicious.</li>
<li>Filter alerts generated by the <code>Suspicious PowerShell TabExpansion Call</code> rule if direct calls originate from trusted administrative or development activities, as noted in the &ldquo;known_false_positives&rdquo; section of the source.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>powershell</category><category>tabexpansion</category><category>bypass</category><category>endpoint</category></item></channel></rss>