<?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/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Evading-Security-Controls - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/evading-security-controls/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 01 Sep 2026 12:19:51 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/evading-security-controls/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>Suspicious Dynamic .NET Compilation via Csc.exe</title><link>https://feed.craftedsignal.io/briefs/2026-09-dynamic-dotnet-compilation/</link><pubDate>Tue, 01 Sep 2026 12:19:51 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-09-dynamic-dotnet-compilation/</guid><description>Attackers utilize the C# compiler (csc.exe) to dynamically compile and execute malicious code in memory, enabling evasion of signature-based defenses and EDR hooks.</description><content:encoded><![CDATA[<p>The C# compiler (csc.exe) is a legitimate component of the .NET framework used for building source code into assemblies. Threat actors, including groups observed in MuddyWater operations and campaigns utilizing Agent Tesla, abuse this utility to perform dynamic, on-the-fly compilation of malicious payloads. By compiling code directly on the target host, attackers avoid writing static malicious binaries to disk, thereby bypassing traditional file-based signature detection. This technique is often employed in the post-exploitation phase to execute custom loaders, stagers, or modules that interact with system APIs to disable security instrumentation or perform further reconnaissance. Defenders should monitor for csc.exe process creation events occurring within non-standard execution paths, such as temporary user directories or user-profile subfolders, which are common staging areas for this activity.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Initial access is established via phishing or exploit, placing a source code file (typically .cs) on the host.</li>
<li>Attacker writes the malicious source code to a temp location, such as C:\Users\Public\ or %TEMP%.</li>
<li>Attacker invokes csc.exe from the command line to compile the written source code.</li>
<li>The compiler (csc.exe) reads the source file and generates an assembly in memory or as a temporary executable.</li>
<li>The resulting assembly is executed, either directly through process injection or via a follow-on execution command.</li>
<li>The malicious assembly executes, performing tasks like API hooking removal or C2 beaconing.</li>
<li>The primary objective, such as credential theft or sensitive data exfiltration, is achieved using the memory-resident code.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful abuse of dynamic compilation allows attackers to execute arbitrary code while significantly reducing their disk footprint. This technique has been observed in global operations targeting varied sectors, allowing actors to maintain persistence and evade endpoint security controls. Failure to detect this activity can lead to long-term undetected presence within a network, resulting in unauthorized data access and potential system compromise.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Deploy the provided Sigma rule to detect suspicious csc.exe execution patterns.</li>
<li>Baseline legitimate csc.exe usage in the environment, specifically identifying build pipelines or automated tools that invoke the compiler from standard directories (e.g., C:\Program Files).</li>
<li>Implement process creation logging via Sysmon (Event ID 1) to capture command line arguments and parent process relationships for csc.exe.</li>
<li>Hunt for anomalous process execution paths for csc.exe (e.g., AppData, Temp, Perflogs) and correlate these events with unexpected network activity or unauthorized API calls.</li>
</ol>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>stealth</category><category>evading-security-controls</category><category>windows</category><category>dot-net</category></item></channel></rss>