<?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>Octopus Deploy — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/octopus-deploy/</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 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/octopus-deploy/feed.xml" rel="self" type="application/rss+xml"/><item><title>PowerShell Script with Encryption/Decryption Capabilities</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-powershell-encryption/</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-powershell-encryption/</guid><description>PowerShell scripts employing .NET cryptography APIs are used to encrypt data for impact or decrypt payloads for defense evasion.</description><content:encoded><![CDATA[<p>This threat brief focuses on the detection of PowerShell scripts utilizing .NET cryptography APIs for file encryption or decryption. Attackers often leverage these capabilities to encrypt data for impact, potentially leading to data exfiltration or ransomware deployment, or to decrypt staged payloads, circumventing traditional security measures. Defenders should be aware of PowerShell scripts employing symmetric cryptography classes (AES/Rijndael, SymmetricAlgorithm), key derivation helpers (PasswordDeriveBytes, Rfc2898DeriveBytes), explicit cipher configurations (CipherMode, PaddingMode), and functions that generate encryptors/decryptors. Identifying such scripts is crucial for preventing both data compromise and the execution of malicious payloads. This detection specifically targets Windows systems where PowerShell is commonly used for both legitimate administration and malicious activities.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains initial access to the target system (e.g., via compromised credentials or a phishing attack).</li>
<li>Attacker uploads or stages a PowerShell script containing encryption/decryption capabilities.</li>
<li>The PowerShell script utilizes .NET cryptography APIs (e.g., <code>AESManaged</code>, <code>RijndaelManaged</code>, <code>PasswordDeriveBytes</code>, <code>Rfc2898DeriveBytes</code>).</li>
<li>The script configures the cipher using <code>CipherMode</code> and <code>PaddingMode</code>.</li>
<li>The script invokes <code>.CreateEncryptor()</code> or <code>.CreateDecryptor()</code> methods to initialize the cryptographic operation.</li>
<li>If encrypting, the script iterates through target files, encrypting their content and potentially renaming or deleting originals.</li>
<li>If decrypting, the script processes an encrypted payload, converting it to executable form or writing it to a new artifact.</li>
<li>The attacker executes the decrypted payload or exfiltrates the encrypted data, completing their objective.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to significant data loss, system downtime, and financial damage. Data encryption for impact can render systems unusable, while the decryption of staged payloads can introduce malware into the environment. The number of victims can vary widely depending on the scope of the attack, ranging from individual workstations to entire networks. Targeted sectors may include any organization reliant on Windows-based systems, with potential consequences including operational disruption, reputational damage, and regulatory fines.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell Script Block Logging to capture the events required for detection, specifically event ID 4104, as detailed in the <a href="https://ela.st/powershell-logging-setup">Elastic PowerShell logging setup guide</a>.</li>
<li>Deploy the Sigma rule <code>PowerShell Script with Encryption/Decryption Capabilities</code> to your SIEM to detect suspicious PowerShell scripts utilizing .NET cryptography APIs.</li>
<li>Investigate alerts triggered by the Sigma rule, focusing on <code>powershell.file.script_block_text</code> to understand the cryptographic intent and data flow.</li>
<li>Tune the Sigma rule by adding exceptions for legitimate PowerShell scripts that use encryption, referencing the &ldquo;False positive analysis&rdquo; section in this brief.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>powershell</category><category>encryption</category><category>defense-evasion</category><category>windows</category></item></channel></rss>