<?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>Command-Line — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/command-line/</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/command-line/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><item><title>Detection of Obfuscated IP Addresses via Command Line Tools</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-obfuscated-ip-cli/</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-03-obfuscated-ip-cli/</guid><description>The use of command-line tools like ping.exe or arp.exe with obfuscated IP addresses (hex, octal, etc.) in the command line can indicate reconnaissance activity or attempts to evade security controls by masking the true destination.</description><content:encoded><![CDATA[<p>Attackers may attempt to obscure their activities by using obfuscated IP addresses within command-line tools. This is done to bypass simple pattern matching or detection rules that rely on standard IP address formats. The Sigma rule &ldquo;Obfuscated IP Via CLI&rdquo; published on 2022-08-03 and modified on 2026-03-16, focuses on detecting this behavior by identifying command lines containing hexadecimal, octal, or other encoded representations of IP addresses used with <code>ping.exe</code> or <code>arp.exe</code>. This activity can indicate reconnaissance, command and control communication, or lateral movement attempts where attackers are trying to hide the true destination of their network traffic.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a Windows system.</li>
<li>The attacker opens a command prompt (cmd.exe) or PowerShell.</li>
<li>The attacker uses <code>ping.exe</code> or <code>arp.exe</code> to test network connectivity.</li>
<li>The attacker crafts a command line that includes an obfuscated IP address (e.g., hexadecimal, octal). For example: <code>ping 0121.04.0174.012</code></li>
<li>The command is executed, attempting to resolve or connect to the obfuscated IP address.</li>
<li>If the obfuscation bypasses security controls, the tool resolves the address.</li>
<li>The attacker gathers information about the target system (if ping is successful) or network.</li>
<li>The attacker uses this information for further exploitation or lateral movement.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of obfuscated IPs can lead to undetected reconnaissance, lateral movement, and data exfiltration. By hiding the true destination of network traffic, attackers can bypass traditional security measures and gain a foothold within the network. The impact includes potential data breaches, system compromise, and disruption of services.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the &ldquo;Obfuscated IP Via CLI&rdquo; Sigma rule to your SIEM to detect command-line execution with obfuscated IP addresses.</li>
<li>Enable process creation logging for <code>ping.exe</code> and <code>arp.exe</code> to ensure the Sigma rule has the necessary data.</li>
<li>Investigate any alerts generated by the Sigma rule to determine if the activity is malicious.</li>
<li>Implement network segmentation to limit the scope of potential lateral movement.</li>
<li>Monitor command-line activity for unusual patterns or arguments.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>reconnaissance</category><category>evasion</category><category>command-line</category></item><item><title>Command Obfuscation via Unicode Modifier Letters</title><link>https://feed.craftedsignal.io/briefs/2024-01-unicode-cmd-obfuscation/</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-unicode-cmd-obfuscation/</guid><description>Adversaries use Unicode modifier letters to obfuscate command-line arguments, evading string-based detections on common Windows utilities like PowerShell and cmd.exe.</description><content:encoded><![CDATA[<p>Attackers are increasingly employing Unicode modifier letters to obfuscate command-line arguments, thereby bypassing traditional string-based detection mechanisms. This technique involves replacing standard ASCII characters with visually similar Unicode characters, making it difficult for simple pattern-matching rules to identify malicious commands. The obfuscation targets common Windows utilities such as <code>reg.exe</code>, <code>net.exe</code>, <code>certutil.exe</code>, <code>PowerShell.exe</code>, <code>cmd.exe</code>, and others frequently abused in post-exploitation scenarios. Defenders need to implement more sophisticated detection methods that account for Unicode normalization or character range analysis to identify and mitigate this threat. This technique has become more prevalent in the last year as attackers seek to evade common detection strategies.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Initial Access: An attacker gains initial access to a Windows system, potentially through phishing or exploiting a vulnerability.</li>
<li>Execution: The attacker executes a command-line utility like <code>cmd.exe</code> or <code>powershell.exe</code> to perform malicious actions.</li>
<li>Obfuscation: The command-line arguments are obfuscated by replacing ASCII characters with Unicode modifier letters.</li>
<li>Defense Evasion: The obfuscation allows the attacker to evade simple string-based detections that would normally flag the command as malicious.</li>
<li>Privilege Escalation: The attacker may use the obfuscated command to escalate privileges or gain access to sensitive resources.</li>
<li>Persistence: The attacker may establish persistence by creating a scheduled task or modifying the registry using obfuscated commands.</li>
<li>Lateral Movement: The attacker may use the obfuscated command to move laterally to other systems on the network.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful command obfuscation can lead to a significant compromise of Windows systems. Attackers can bypass security controls and execute malicious code undetected, potentially leading to data theft, system disruption, or ransomware deployment. The obfuscation makes it harder for security teams to identify and respond to attacks, increasing the dwell time and potential damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule provided below to detect the presence of Unicode modifier letters in command lines (references: Sigma rules).</li>
<li>Enable Sysmon process creation logging to capture command-line arguments for analysis (references: Sysmon setup instructions).</li>
<li>Investigate any alerts triggered by the Sigma rule and analyze the raw command lines to identify the true intent of the command (references: Triage and Analysis section of the source).</li>
<li>Consider implementing Unicode normalization techniques to remove the obfuscation before analyzing command lines.</li>
<li>Monitor the listed processes (<code>reg.exe</code>, <code>net.exe</code>, <code>certutil.exe</code>, etc.) more closely for suspicious activity.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>defense-evasion</category><category>command-line</category><category>unicode</category><category>obfuscation</category></item></channel></rss>