<?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>Cobaltstrike — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/cobaltstrike/</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/tags/cobaltstrike/feed.xml" rel="self" type="application/rss+xml"/><item><title>Detection of Default Cobalt Strike PowerShell Beacon</title><link>https://feed.craftedsignal.io/briefs/2024-01-cobalt-strike-powershell-beacon/</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-cobalt-strike-powershell-beacon/</guid><description>This brief outlines detection strategies for default Cobalt Strike PowerShell beacons, which are used for command and control, by identifying specific function and variable names within PowerShell script block logs.</description><content:encoded><![CDATA[<p>Cobalt Strike is a popular commercial penetration testing tool often abused by threat actors for command and control (C2) after initial compromise. This brief focuses on detecting the default PowerShell beacon component of Cobalt Strike, which uses recognizable function and variable names in its scripts. By identifying these default names within PowerShell script block logs, defenders can detect Cobalt Strike activity even if the initial delivery mechanism is unknown. This detection is focused on the default variable names and function names within the tool and as such more sophisticated users of the tool may modify their scripts to evade this detection. This brief will aid in detecting default Cobalt Strike PowerShell beacons, giving defenders a chance to respond quickly.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker gains initial access to a target system through various means (e.g., spear phishing, exploiting a vulnerability).</li>
<li>A PowerShell script is executed on the target system, either through direct execution or by being called from another process (cmd.exe, mshta.exe).</li>
<li>The PowerShell script contains default Cobalt Strike PowerShell beacon code, including functions and variables like <code>func_get_proc_address</code>, <code>$var_unsafe_native_methods</code>, <code>$var_gpa.Invoke</code>, <code>func_get_delegate_type</code>, and <code>$var_type_builder</code>.</li>
<li>The script uses these functions and variables to dynamically load and execute malicious code in memory, bypassing traditional file-based antivirus solutions.</li>
<li>The beacon establishes a connection to the attacker&rsquo;s C2 server, allowing for remote command execution.</li>
<li>The attacker uses the C2 connection to perform reconnaissance, move laterally within the network, and escalate privileges.</li>
<li>The attacker deploys additional tools or malware to achieve their objectives, such as data exfiltration or ransomware deployment.</li>
<li>The attacker maintains persistence on the compromised system to ensure continued access.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation via Cobalt Strike can lead to a complete compromise of the targeted system and potentially the entire network. Attackers can steal sensitive data, deploy ransomware, disrupt business operations, and cause significant financial and reputational damage. While the exact number of victims is unknown, Cobalt Strike is used in a wide range of attacks across various sectors, including healthcare, finance, and government. A successful attack could lead to significant data breaches, system downtime, and regulatory fines.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell script block logging (Event ID 4104) on all Windows endpoints to capture the necessary data for detection.</li>
<li>Deploy the Sigma rule &ldquo;Detect Default Cobalt Strike PowerShell Beacon&rdquo; to your SIEM and tune for your environment using the included false positive guidance.</li>
<li>Investigate any alerts generated by the Sigma rule, paying close attention to the parent processes and network connections associated with the PowerShell scripts.</li>
<li>Implement network segmentation to limit the lateral movement of attackers within the network after initial compromise.</li>
<li>Review and update PowerShell execution policies to prevent the execution of unsigned or untrusted scripts.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cobaltstrike</category><category>powershell</category><category>beacon</category><category>commandandcontrol</category><category>windows</category></item><item><title>Cobalt Strike PowerShell Loader Detection</title><link>https://feed.craftedsignal.io/briefs/2024-01-cobalt-strike-powershell-loader/</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-cobalt-strike-powershell-loader/</guid><description>This brief details a detection for a PowerShell loader pattern commonly used with Cobalt Strike to decompress and execute payloads, often observed in scripted web delivery attacks.</description><content:encoded><![CDATA[<p>This brief focuses on detecting the PowerShell loader pattern frequently employed by Cobalt Strike, a commercial penetration testing tool often abused by threat actors, including ransomware groups, for malicious purposes. Cobalt Strike is favored due to its stealthy and customizable beacons, enabling encrypted communication with command-and-control (C2) servers. The PowerShell loader decompresses executable payloads, facilitating the execution of malicious code on compromised systems. This technique is observed in various attack scenarios, including scripted web delivery, where attackers leverage PowerShell to download and execute malicious payloads directly from web servers. Defenders should prioritize detecting this pattern to identify and prevent Cobalt Strike infections early in the attack chain.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li><strong>Initial Access:</strong> The attacker gains initial access through various means, such as exploiting web application vulnerabilities or using social engineering to trick users into clicking malicious links.</li>
<li><strong>Web Delivery:</strong> A user clicks a link, leading to the download of a malicious file or script.</li>
<li><strong>PowerShell Execution:</strong> The downloaded file, often a script, executes PowerShell.</li>
<li><strong>Loader Invocation:</strong> The PowerShell script contains the Cobalt Strike PowerShell loader code, designed to decompress and execute the embedded payload.</li>
<li><strong>Decompression:</strong> The PowerShell loader utilizes <code>IO.Compression.GzipStream</code> to decompress a Gzip-compressed executable payload.</li>
<li><strong>Payload Execution:</strong> After decompression, the payload is executed in memory using <code>IEX</code> (Invoke-Expression).</li>
<li><strong>Beacon Deployment:</strong> The executed payload deploys a Cobalt Strike Beacon, establishing a connection with the C2 server.</li>
<li><strong>Command and Control:</strong> The attacker gains remote access to the compromised system and can perform various actions, such as data exfiltration, lateral movement, or deploying ransomware.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation can lead to complete system compromise, allowing attackers to steal sensitive data, deploy ransomware, or use the compromised system as a foothold for further attacks within the network. Cobalt Strike&rsquo;s flexibility and stealth make it a potent tool for advanced persistent threats (APTs) and ransomware operators, potentially impacting organizations across various sectors. Early detection of the PowerShell loader can prevent significant damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable PowerShell Script Block Logging (Event ID 4104) to capture the necessary data for detecting the Cobalt Strike PowerShell loader pattern.</li>
<li>Deploy the provided Sigma rule (<code>Cobalt Strike PowerShell Loader</code>) to your SIEM to identify PowerShell scripts containing the GzipStream decompression pattern.</li>
<li>Review and whitelist legitimate penetration testing activities and authorized red team exercises to reduce false positives, as detailed in the <code>known_false_positives</code> section.</li>
<li>Investigate systems where the Sigma rule triggers to determine the origin of the malicious PowerShell script and contain the potential breach.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>cobaltstrike</category><category>powershell</category><category>malware</category><category>windows</category></item></channel></rss>