<?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>Base64 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/base64/</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:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/base64/feed.xml" rel="self" type="application/rss+xml"/><item><title>Long Base64 Encoded Command via Scripting Interpreter</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-long-base64-interpreter-cmdline/</link><pubDate>Wed, 03 Jan 2024 17:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-long-base64-interpreter-cmdline/</guid><description>Detection of oversized command lines used by Python, PowerShell, Node.js, or Deno interpreters containing base64 decoding or encoded-command patterns, indicating potential evasion and malicious execution.</description><content:encoded><![CDATA[<p>This rule identifies the execution of scripting interpreters (Python, PowerShell, Node.js, and Deno) with unusually long command lines containing base64 encoded payloads. The rule focuses on scenarios where the initial <code>process.command_line</code> field is ignored due to its excessive length, but the complete command line is still available in <code>process.command_line.text</code>. Attackers leverage this technique to evade traditional command-line inspection and execute malicious content across Windows, macOS, and Linux systems. This approach allows attackers to embed and execute code without writing it to disk, making it harder to detect. The rule is designed to detect this behavior, allowing for closer inspection of the executed commands and their intent.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a system (e.g., via phishing or exploiting a vulnerability).</li>
<li>The attacker uses PowerShell, Python, Node.js, or Deno to execute commands.</li>
<li>A long, base64-encoded string is crafted, designed to evade detection.</li>
<li>The interpreter is invoked with the encoded string passed as an argument, exceeding typical command-line limits.</li>
<li>The <code>process.command_line</code> field is truncated due to its length, but the full command line is available in <code>process.command_line.text</code>.</li>
<li>The interpreter decodes and executes the payload from the <code>process.command_line.text</code>.</li>
<li>The decoded payload performs malicious actions such as downloading malware, establishing persistence, or exfiltrating data.</li>
<li>The attacker achieves their objective, such as gaining control of the system or stealing sensitive information.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to a wide range of malicious activities, including malware installation, data theft, privilege escalation, and system compromise. Due to the defense evasion capabilities, it is difficult to identify and prevent. The impact includes potential data breaches, financial losses, and reputational damage. The rule&rsquo;s detection helps defenders identify this attack vector and prevent further exploitation of affected systems.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Detect Long Base64 Encoded Command via Scripting Interpreter</code> to your SIEM to detect this behavior.</li>
<li>Investigate any alerts generated by this rule, focusing on the <code>process.command_line.text</code> field to understand the full command being executed.</li>
<li>Review parent processes and execution chains of the interpreter to understand the initial attack vector.</li>
<li>Implement controls to restrict the execution of scripting interpreters from untrusted sources.</li>
<li>Monitor process execution logs for command lines exceeding a certain length threshold.</li>
<li>Improve logging coverage to capture the full command line even when it exceeds standard limits.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>defense-evasion</category><category>execution</category><category>scripting-interpreter</category><category>base64</category><category>command-line</category></item></channel></rss>