<?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>Amsi — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/amsi/</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>Sat, 27 Jan 2024 18:23:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/amsi/feed.xml" rel="self" type="application/rss+xml"/><item><title>AMSI Enable Registry Key Modification for Defense Evasion</title><link>https://feed.craftedsignal.io/briefs/2024-01-amsi-registry-disable/</link><pubDate>Sat, 27 Jan 2024 18:23:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-amsi-registry-disable/</guid><description>Adversaries modify the AmsiEnable registry key to 0 to disable Windows Script AMSI scanning, bypassing AMSI protections for Windows Script Host or JScript execution.</description><content:encoded><![CDATA[<p>Attackers can disable the Antimalware Scan Interface (AMSI) to evade detection by modifying the <code>AmsiEnable</code> registry key. This technique is commonly employed to execute malicious scripts without triggering security warnings or blocks. The AMSI, a Windows feature, allows applications and services to request the scanning of potentially malicious content (e.g., PowerShell scripts, JScript) before execution. By setting the <code>AmsiEnable</code> value to 0, an attacker can disable AMSI for the current user, effectively bypassing real-time script scanning. This action is often a precursor to deploying further malicious payloads or establishing persistence on a compromised system. This behavior has been observed since at least 2019 and continues to be a relevant defense evasion technique.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to the target system, possibly through phishing or exploiting a vulnerability.</li>
<li>The attacker executes a script or binary that attempts to modify the <code>AmsiEnable</code> registry key.</li>
<li>The script or binary uses <code>reg.exe</code>, PowerShell, or another tool to set the <code>AmsiEnable</code> registry value to 0. The registry key location is typically <code>HKEY_USERS\&lt;SID&gt;\Software\Microsoft\Windows Script\Settings\AmsiEnable</code>.</li>
<li>After successfully disabling AMSI, the attacker proceeds to execute malicious scripts or code. These scripts may use <code>powershell.exe</code>, <code>wscript.exe</code>, or <code>cscript.exe</code>.</li>
<li>The malicious scripts download and execute additional payloads, such as malware or remote access tools (RATs).</li>
<li>The attacker performs lateral movement within the network using the compromised system as a pivot.</li>
<li>The attacker attempts to establish persistence, ensuring continued access to the system even after reboots.</li>
<li>The attacker exfiltrates sensitive data or deploys ransomware to achieve their objectives.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful modification of the <code>AmsiEnable</code> registry key allows attackers to execute malicious scripts without triggering AMSI alerts, leading to potential malware infections, data breaches, and system compromise. Disabling AMSI significantly reduces the effectiveness of endpoint security solutions, making the system more vulnerable to attack. The impact can range from individual workstation compromise to widespread network infections, depending on the attacker&rsquo;s objectives and the organization&rsquo;s security posture.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Detect AmsiEnable Registry Modification via Registry Events</code> to your SIEM to detect modifications to the <code>AmsiEnable</code> registry key.</li>
<li>Enable Sysmon registry event logging to provide the necessary data for the Sigma rule to function.</li>
<li>Monitor process creation events for processes modifying registry keys, especially <code>reg.exe</code> and PowerShell, using the rule <code>Detect AmsiEnable Registry Modification via Process Creation</code>.</li>
<li>Investigate any alerts generated by these rules promptly to determine if the activity is malicious or legitimate.</li>
<li>Implement application control policies to restrict the execution of unsigned or untrusted scripts and binaries.</li>
<li>Harden systems by restricting user permissions to modify critical registry keys.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>defense-evasion</category><category>amsi</category><category>registry</category><category>windows</category></item><item><title>Potential Antimalware Scan Interface Bypass via PowerShell</title><link>https://feed.craftedsignal.io/briefs/2024-01-amsi-bypass-powershell/</link><pubDate>Tue, 09 Jan 2024 16:23:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-amsi-bypass-powershell/</guid><description>This rule detects PowerShell scripts that attempt to bypass the Antimalware Scan Interface (AMSI) in order to disable scanning and execute malicious PowerShell code undetected.</description><content:encoded><![CDATA[<p>This detection identifies PowerShell scripts that attempt to circumvent the Antimalware Scan Interface (AMSI), a security feature in Windows designed to prevent the execution of malicious scripts and code. Attackers use AMSI bypass techniques to disable real-time scanning and execute malicious PowerShell code without detection. The bypasses often involve manipulating AMSI&rsquo;s internal state or patching its scanning routines. This allows attackers to deliver and execute payloads undetected, leading to potential system compromise. This technique is actively used by various threat actors to evade defenses.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to the system, typically through phishing or exploiting a vulnerability.</li>
<li>The attacker executes a PowerShell script.</li>
<li>The PowerShell script contains code designed to bypass AMSI, such as manipulating the AmsiScanBuffer function or unmanaged code injection.</li>
<li>The AMSI bypass is executed, disabling real-time scanning of PowerShell scripts.</li>
<li>The attacker then executes a malicious payload within the same PowerShell session, which is no longer subject to AMSI scanning.</li>
<li>The malicious payload performs actions such as downloading additional malware, establishing persistence, or exfiltrating data.</li>
<li>The attacker leverages the compromised system for further lateral movement or to achieve their objectives, such as data theft or ransomware deployment.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful AMSI bypass can lead to the execution of arbitrary code on the affected system, potentially resulting in data breaches, system compromise, and the installation of malware. Because AMSI is a core component of Windows security, its bypass represents a significant security risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell Script Block Logging to capture the contents of PowerShell scripts, which is essential for this detection to function effectively (reference: Setup section).</li>
<li>Deploy the Sigma rule &ldquo;Potential Antimalware Scan Interface Bypass via PowerShell&rdquo; to detect scripts containing known AMSI bypass techniques (reference: rules section below).</li>
<li>Investigate alerts generated by the Sigma rule, focusing on the script content and the context in which it was executed to identify potential malicious activity (reference: note section).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>defense-evasion</category><category>amsi</category><category>powershell</category><category>windows</category></item></channel></rss>