<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Threat-Hunting on Clean Tech</title><link>http://www.lineon.fr/tags/threat-hunting/</link><description>Recent content in Threat-Hunting on Clean Tech</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 28 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="http://www.lineon.fr/tags/threat-hunting/index.xml" rel="self" type="application/rss+xml"/><item><title>Writing Effective YARA Rules for Cobalt Strike Beacon Detection</title><link>http://www.lineon.fr/posts/yara-rules-for-cobalt-strike/</link><pubDate>Sat, 28 Mar 2026 00:00:00 +0000</pubDate><guid>http://www.lineon.fr/posts/yara-rules-for-cobalt-strike/</guid><description>&lt;p&gt;Cobalt Strike remains one of the most prevalent post-exploitation frameworks used by both red teams and threat actors. Detecting its beacons through YARA rules is a fundamental skill for any SOC analyst or threat hunter.&lt;/p&gt;
&lt;h2 id="understanding-beacon-artifacts"&gt;Understanding beacon artifacts&lt;/h2&gt;
&lt;p&gt;Cobalt Strike beacons leave identifiable patterns in both their staged and stageless payloads. The key areas to target are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Configuration blocks&lt;/strong&gt; — the beacon stores its config in a predictable structure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sleep mask routines&lt;/strong&gt; — the obfuscation applied during sleep cycles&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Named pipe patterns&lt;/strong&gt; — default pipe names are a common indicator&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="a-basic-detection-rule"&gt;A basic detection rule&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rule CobaltStrike_Beacon_Config
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; meta:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; description = &amp;#34;Detects Cobalt Strike beacon configuration block&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; author = &amp;#34;SOC Team&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; date = &amp;#34;2026-03&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; severity = &amp;#34;high&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; strings:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $config_header = { 00 01 00 01 00 02 ?? ?? 00 02 00 01 00 02 ?? ?? }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $default_pipe = &amp;#34;\\\\.\\pipe\\msagent_&amp;#34; ascii wide
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $watermark = { 00 09 00 02 00 04 }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; condition:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; uint16(0) == 0x5A4D and
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; filesize &amp;lt; 1MB and
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ($config_header or $default_pipe) and
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $watermark
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="hunting-in-memory"&gt;Hunting in memory&lt;/h2&gt;
&lt;p&gt;For in-memory detection, you&amp;rsquo;ll want rules that match against the decrypted beacon configuration. Use a tool like &lt;code&gt;pe-sieve&lt;/code&gt; or &lt;code&gt;BeaconEye&lt;/code&gt; to dump process memory first, then scan:&lt;/p&gt;</description></item></channel></rss>