<?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>Script-Execution — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/script-execution/</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 15:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/script-execution/feed.xml" rel="self" type="application/rss+xml"/><item><title>Script Execution via Microsoft HTML Application</title><link>https://feed.craftedsignal.io/briefs/2024-01-script-execution-via-html-app/</link><pubDate>Wed, 03 Jan 2024 15:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-script-execution-via-html-app/</guid><description>Detects the execution of scripts via HTML applications using Windows utilities rundll32.exe or mshta.exe to bypass defenses by proxying execution of malicious content with signed binaries.</description><content:encoded><![CDATA[<p>This detection identifies the execution of scripts via HTML applications, leveraging Windows utilities like <code>rundll32.exe</code> or <code>mshta.exe</code>. Attackers often use this method to bypass process and signature-based defenses by proxying the execution of malicious content through legitimate, signed binaries. The detection focuses on specific command-line arguments and patterns associated with this technique, while also excluding known legitimate uses by applications such as Citrix System32 (<code>wfshell.exe</code>), Microsoft Access (<code>MSACCESS.EXE</code>), and Quokka.Works (<code>GTInstaller.exe</code>). This technique is used by attackers to execute malicious scripts without directly running them, thus evading traditional security measures. The detection rule analyzes process names, command-line arguments, parent processes, and file paths to identify potentially malicious activity indicative of defense evasion.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access through various means (e.g., phishing, drive-by download).</li>
<li>The attacker leverages a malicious HTML application (HTA) file or a scriptlet (SCT) file.</li>
<li>The attacker uses <code>mshta.exe</code> or <code>rundll32.exe</code> to execute the malicious HTA or SCT file. The command line includes obfuscated or encoded script content.</li>
<li><code>mshta.exe</code> or <code>rundll32.exe</code> process spawns a child process, such as <code>cmd.exe</code> or <code>powershell.exe</code>, to execute further commands.</li>
<li>The spawned process executes malicious code, such as downloading and executing a payload.</li>
<li>The attacker achieves persistence by modifying registry keys or creating scheduled tasks.</li>
<li>The attacker performs lateral movement by exploiting vulnerabilities or using stolen credentials.</li>
<li>The final objective is achieved, such as data exfiltration, ransomware deployment, or system compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to arbitrary code execution, allowing attackers to compromise the system, steal sensitive data, deploy ransomware, or establish a persistent foothold. Due to the nature of the technique, it can bypass many traditional security measures. The wide adoption of Windows and the inherent trust placed in signed binaries makes this a potent evasion technique. Failure to detect and prevent this attack can lead to significant financial and reputational damage for the targeted organization.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Script Execution via Microsoft HTML Application&rdquo; to your SIEM to detect suspicious <code>mshta.exe</code> and <code>rundll32.exe</code> executions. Tune the rule by adding exceptions for known legitimate uses in your environment.</li>
<li>Enable Sysmon process creation logging (Event ID 1) to ensure the visibility required for the Sigma rules to function correctly.</li>
<li>Monitor process command lines for suspicious arguments like &ldquo;script:eval&rdquo;, &ldquo;WScript.Shell&rdquo;, and &ldquo;mshta http&rdquo; which are indicative of this technique.</li>
<li>Implement application control policies to restrict the execution of <code>mshta.exe</code> and <code>rundll32.exe</code> where they are not required for legitimate business purposes.</li>
<li>Investigate and block any identified malicious HTA files or scriptlet URLs found in the command lines of detected processes.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>defense-evasion</category><category>script-execution</category><category>windows</category></item><item><title>Suspicious Script Interpreter Execution from Environment Variable Folders</title><link>https://feed.craftedsignal.io/briefs/2024-01-suspicious-script-execution/</link><pubDate>Wed, 03 Jan 2024 14:30:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-suspicious-script-execution/</guid><description>Malware may execute scripts from suspicious directories accessible via environment variables using script interpreters like cscript, wscript, mshta, and powershell to evade detection.</description><content:encoded><![CDATA[<p>Attackers may attempt to execute malicious scripts from suspicious directories or folders accessible by environment variables. This technique leverages script interpreters such as <code>cscript.exe</code>, <code>wscript.exe</code>, <code>mshta.exe</code>, and <code>powershell.exe</code> to run scripts from locations like the Temp directory, the Public user folder, or other user profile directories. The use of these locations can help attackers evade detection, as security tools may not thoroughly inspect files executed from these typically benign locations. This activity has been associated with threat actors such as Shuckworm, known to target Ukraine military.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker gains initial access, potentially through phishing or exploiting a software vulnerability.</li>
<li>A malicious script is dropped into a suspicious folder such as <code>C:\Users\Public\</code>, <code>%TEMP%</code>, or <code>C:\Users\&lt;username&gt;\AppData\Local\Temp</code>.</li>
<li>The attacker uses <code>cscript.exe</code>, <code>wscript.exe</code>, or <code>mshta.exe</code> to execute the dropped script. The command line may contain flags to bypass execution policies (e.g., <code>-ExecutionPolicy bypass</code>) or hide the window (e.g., <code>-w hidden</code>).</li>
<li>Alternatively, PowerShell may be invoked with the <code>-ep bypass</code> or <code>-ExecutionPolicy Bypass</code> flags, along with a command to execute the script located in the temporary folder.</li>
<li>The script executes, performing malicious actions such as downloading additional payloads, establishing persistence, or exfiltrating data.</li>
<li>The script may leverage built-in Windows utilities for further malicious activities.</li>
<li>The attacker achieves their objective, such as data theft or system compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to a range of damaging outcomes, including system compromise, data theft, and further propagation of malware within the network. Organizations may experience data breaches, financial losses, and reputational damage. The compromise of systems can also disrupt business operations and require extensive recovery efforts.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Script Interpreter Execution From Suspicious Folder</code> to your SIEM to detect suspicious script executions.</li>
<li>Monitor process creation events with a focus on script interpreters (<code>cscript.exe</code>, <code>wscript.exe</code>, <code>mshta.exe</code>, <code>powershell.exe</code>) executing from suspicious directories, using the <code>logsource</code> and <code>detection</code> sections of the Sigma rule as a guide.</li>
<li>Tune the filters in the Sigma rule based on your environment to reduce false positives, as described in the <code>falsepositives</code> section.</li>
<li>Review and block any observed malicious command lines containing flags like <code>-ep bypass</code>, <code>-ExecutionPolicy bypass</code>, or <code>-w hidden</code>, as detailed in the <code>selection_proc_flags</code> section of the Sigma rule.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>execution</category><category>script-execution</category><category>malware</category></item></channel></rss>