<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sandboxteam &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/sandboxteam/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 19:20:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ptesc.tech/wp-content/uploads/2026/09/cropped-cropped-large_icon-32x32.png</url>
	<title>sandboxteam &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>.NET Reactor: evolution of protection from 6.7 to 7.0 and methods for removing obfuscation</title>
		<link>https://ptesc.tech/en/net-reactor-the-evolution-of-protection-from-6-7-to-7-0-and-methods-for-removing/</link>
		
		<dc:creator><![CDATA[global_author]]></dc:creator>
		<pubDate>Mon, 03 Mar 2025 18:06:33 +0000</pubDate>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[avlab]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[obfuscation]]></category>
		<category><![CDATA[sandboxteam]]></category>
		<guid isPermaLink="false">https://ptesc.tech/net-reactor-%d1%8d%d0%b2%d0%be%d0%bb%d1%8e%d1%86%d0%b8%d1%8f-%d0%b7%d0%b0%d1%89%d0%b8%d1%82%d1%8b-%d1%81-6-7-%d0%b4%d0%be-7-0-%d0%b8-%d0%bc%d0%b5%d1%82%d0%be%d0%b4%d1%8b-%d1%81%d0%bd%d1%8f%d1%82/</guid>

					<description><![CDATA[.NET Reactor: The Evolution of Protection from 6.7 to 7.0 and Methods for Removing Obfuscation 🔄 .NET Reactor is a powerful tool for protecting executables written in C# from decompilation and reverse engineering. It provides various method…]]></description>
										<content:encoded><![CDATA[<p><strong>.NET Reactor: The Evolution of Protection from 6.7 to 7.0 and Methods for Removing Obfuscation</strong> 🔄</p>
<p>.NET Reactor is a powerful tool for protecting executables written in C# from decompilation and reverse engineering. It provides various methods of obfuscation and licensing, ensuring the security of developers&#8217; intellectual property. </p>
<p>But, as is usually the case, it is not only used for good purposes: experts at the PT ESC antivirus laboratory often encounter malicious files protected from analysis by .Net Reactor.</p>
<p>🔓 <strong>How is it protected?</strong></p>
<p>.NET Reactor uses several layers of protection to prevent decompilation and code analysis:</p>
<p><strong>• NecroBit IL Code Protection:</strong> replaces the CIL code of methods with encrypted code, making decompilation and recovery of the source code impossible.</p>
<p><strong>• Code virtualization:</strong> transforms the source code into a set of instructions different from .NET IL, which are interpreted at runtime by a virtual machine, complicating analysis and recovery of the original code.</p>
<p><strong>• Control Flow Obfuscation:</strong> transforms the code of methods into a tangled structure, complicating understanding of the program&#8217;s logic and hindering the work of decompilers (<em>example — in screenshot 1</em>).</p>
<p><strong>• String Encryption:</strong> encrypts strings in the code, preventing their reading and analysis, which complicates understanding of the application&#8217;s functionality, as shown <em>in screenshot 2</em>.</p>
<p><strong>• Anti-Debug mechanisms (Anti Debug):</strong> injects checks for the presence of debuggers, terminating the process when they are detected, which impedes dynamic analysis of the application. </p>
<p>🆕 <strong>What&#8217;s new?</strong></p>
<p>• .NET 6.0 support: provides protection for the latest applications on this platform.</p>
<p>• Improvements in code virtualization and Control Flow Obfuscation provide a further increase in the reliability and complexity of obfuscation.</p>
<p>• Hiding the contents of merged .NET Core, 5.0, 6.0 applications prevents viewing the contents using tools such as ILSpy / dnSpy.</p>
<p>🧐 <strong>How to analyze?</strong></p>
<p>Despite the complexity of the protection, there are tools that make life easier for reverse engineers.<br />
NETReactorSlayer — a powerful tool for reversing applications obfuscated with .NET Reactor. Its main features:</p>
<p>• NecroBit decryption — restores CIL code from encrypted methods;</p>
<p>• removal of proxies and wrappers — cleans the code of garbage added by the obfuscator (<em>see screenshot 3</em>);</p>
<p>• decoding of strings and resources — returns readable strings encrypted in the application;</p>
<p>• bypassing anti-debug and code tamper protection.</p>
<p>However, starting with version 6.9, the original version of Net Reactor Slayer stopped coping with deobfuscating the protection even with basic parameters. Thanks to the open source code and a fairly large community, in pull requests you can find fixed code that works perfectly even on the very latest version of the obfuscator.</p>
<p>But things are not so smooth with virtualized code: Net Reactor Slayer cannot handle it. If you are lucky and the file was protected with version <code>6.9.0.0</code>, then you can avoid wasting time on manual analysis of the virtual machine and use VMAttack — a tool for devirtualizing .NET applications, which supports this version of .NET Reactor. And if you are not lucky — the easiest way is to analyze the file by its behavior, for example using PT Sandbox.</p>
<p>☝️ <strong>Conclusion</strong></p>
<p>.NET Reactor remains one of the most popular obfuscators for .NET. With each version, the protection becomes more complex, especially through virtualization. If you are going to analyze it — stock up on patience and good tools.</p>
<figure class="wp-block-image"><img width="1024" height="320" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_214@03-03-2025_18-06-33-1024x320.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_214@03-03-2025_18-06-33-1024x320.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_214@03-03-2025_18-06-33-300x94.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_214@03-03-2025_18-06-33-768x240.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_214@03-03-2025_18-06-33.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="601" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_215@03-03-2025_18-06-33-1024x601.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_215@03-03-2025_18-06-33-1024x601.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_215@03-03-2025_18-06-33-300x176.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_215@03-03-2025_18-06-33-768x451.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_215@03-03-2025_18-06-33.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p><span class="hashtag">#avlab</span> <span class="hashtag">#sandboxteam</span> <span class="hashtag">#dotnet</span> <span class="hashtag">#obfuscation</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Do you automate debugging?</title>
		<link>https://ptesc.tech/en/do-you-automate-debugging/</link>
		
		<dc:creator><![CDATA[global_author]]></dc:creator>
		<pubDate>Fri, 21 Feb 2025 14:34:37 +0000</pubDate>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[avlab]]></category>
		<category><![CDATA[sandboxteam]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b0-%d0%b2%d1%8b-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d0%b7%d0%b8%d1%80%d1%83%d0%b5%d1%82%d0%b5-%d0%be%d1%82%d0%bb%d0%b0%d0%b4%d0%ba%d1%83/</guid>

					<description><![CDATA[Do you automate debugging? 🧐 The PT Sandbox expert team often has to debug various Windows kernel components in their work, and a kernel debugger is indispensable here. The more often we do this, the greater our desire to optimize this proc…]]></description>
										<content:encoded><![CDATA[<strong>Do you automate debugging?</strong> 🧐<br />
<br />
The PT Sandbox expert team often has to debug various Windows kernel components in their work, and a kernel debugger is indispensable here. The more often we do this, the greater our desire to optimize this process.<br />
<br />
Often during debugging, you want to see changes in variables, arguments, and various runtime values. This can be achieved with conditional breakpoints and commands. Many years ago, WinDbg gained support for <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/using-linq-with-the-debugger-objects" rel="noopener" target="_blank">a new data model.</a> With the <code>dx</code> command, you can declare your own variables, structures, call JavaScript functions, and make LINQ queries.<br />
<br />
For example, we want to log all files opened by the <code>explorer.exe</code> process:<br />
<br />
<pre class="wp-block-code"><span><code lang="powershell" class="hljs language-powershell language-powershell"><span class="hljs-number">0</span>: kd&gt; dx <span class="hljs-selector-tag">@</span><span class="hljs-variable">$explorer</span> = <span class="hljs-string">"explorer.exe"</span>
<span class="hljs-number">0</span>: kd&gt; bp /w <span class="hljs-string">"@<span class="hljs-variable">$curprocess</span>.Name.ToLower().StartsWith(@<span class="hljs-variable">$explorer</span>)"</span> nt!NtCreateFile <span class="hljs-string">"dx ((_OBJECT_ATTRIBUTES*)@r8)-&gt;ObjectName-&gt;Buffer; gc"</span>
</code></span></pre><br />
<br />
If the conditions or interception logic are more complex, a script is indispensable. Let&#8217;s look at an example.<br />
<br />
Suppose we want to catch and save shellcode injected into a remote process. To do this, we need to intercept the <code>NtWriteVirtualMemory</code> function, check whether the handle belongs to the current process, and if not, save the memory region to disk. Here&#8217;s what it looks like in a script:<br />
<br />
<pre class="wp-block-code"><span><code lang="javascript" class="hljs language-javascript language-javascript"><span class="hljs-meta">"use strict"</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">WriteMemoryCallback</span>(<span class="hljs-params"></span>)
</span>{
    <span class="hljs-keyword">if</span>  (host.currentThread.Registers.User.rcx == <span class="hljs-number">-1</span>)
    {
        <span class="hljs-keyword">return</span>;
    }

    <span class="hljs-keyword">let</span> address = host.currentThread.Registers.User.rdx; 
    <span class="hljs-keyword">let</span> buffer  = host.currentThread.Registers.User.r8;
    <span class="hljs-keyword">let</span> length  = host.currentThread.Registers.User.r9;
    <span class="hljs-keyword">let</span> filename = ${host.currentProcess.Name}-${buffer.toString(<span class="hljs-number">16</span>)}.dmp;

    <span class="hljs-keyword">let</span> file = host.namespace.Debugger.Utility.FileSystem.TempDirectory.CreateFile(
        filename, <span class="hljs-string">'CreateNew'</span>);

    file.WriteBytes(host.memory.readMemoryValues(buffer, length, <span class="hljs-number">1</span>));
    host.diagnostics.debugLog(<span class="hljs-string">`dumped <span class="hljs-subst">${length}</span> bytes to <span class="hljs-subst">${filename}</span>\n`</span>);
    file.Close();
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">initializeScript</span>(<span class="hljs-params"></span>)
</span>{
    <span class="hljs-keyword">return</span> &#91;<span class="hljs-keyword">new</span> host.apiVersionSupport(<span class="hljs-number">1</span>, <span class="hljs-number">9</span>)];
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">invokeScript</span>(<span class="hljs-params"></span>)
</span>{
    <span class="hljs-keyword">let</span> bp = host.namespace.Debugger.Utility.Control.SetBreakpointAtOffset(<span class="hljs-string">"NtWriteVirtualMemory"</span>, <span class="hljs-number">0</span>, <span class="hljs-string">"nt"</span>);
    bp.Command = <span class="hljs-string">`dx @$scriptContents.WriteMemoryCallback(); gc`</span>;
}
</code></span></pre><br />
<br />
Sometimes the set of APIs provided by the JavaScript engine may not be enough — with <code>ExecuteCommand</code> you can call any debugger command, for example to delete a breakpoint or set one at a specific address:<br />
<br />
<pre class="wp-block-code"><span><code lang="javascript" class="hljs language-javascript language-javascript"><span class="hljs-keyword">let</span> exec = host.namespace.Debugger.Utility.Control.ExecuteCommand;
<span class="hljs-keyword">let</span> command = <span class="hljs-string">`dx @$scriptContents.BreakPointCallback(); gc`</span>;
exec(<span class="hljs-string">"bc *"</span>);
exec(<span class="hljs-string">`bp 0xfffffc024d546a88 "<span class="hljs-subst">${command}</span>"`</span>);
</code></span></pre><br />
<br />
JavaScript also allows you to <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/using-linq-with-the-debugger-objects" rel="noopener" target="_blank">extend the debugger&#8217;s data model,</a> for example by adding info about the sections of loaded DLLs or an additional command similar to <code>!handle</code>, <code>!address</code>, etc.<br />
<br />
Suppose we want to enumerate the callbacks for process creation, thread creation, and DLL loading. To do this, we need to create a command, for example <code>!callbacks</code>:<br />
<br />
<pre class="wp-block-code"><span><code lang="javascript" class="hljs language-javascript language-javascript"><span class="hljs-keyword">const</span> log  = <span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> host.diagnostics.debugLog(x + <span class="hljs-string">'\n'</span>);
<span class="hljs-keyword">const</span> u64  = <span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> host.memory.readMemoryValues(x, <span class="hljs-number">1</span>, <span class="hljs-number">8</span>)&#91;<span class="hljs-number">0</span>];
<span class="hljs-keyword">const</span> exec = <span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> host.namespace.Debugger.Utility.Control.ExecuteCommand(x);

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">ParseCallbacks</span>(<span class="hljs-params">Symbol, Size</span>)
</span>{
    log(&#91;+] ${<span class="hljs-built_in">Symbol</span>}:);
    <span class="hljs-keyword">let</span> base = host.getModuleSymbolAddress(<span class="hljs-string">"nt"</span>, <span class="hljs-built_in">Symbol</span>);
    <span class="hljs-keyword">if</span> (base == <span class="hljs-literal">null</span>)
        <span class="hljs-keyword">return</span>;
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; Size; i++)
    {
        <span class="hljs-keyword">let</span> entry = u64(base.add(i * <span class="hljs-number">8</span>));
        <span class="hljs-keyword">if</span> (entry.compareTo(<span class="hljs-number">0</span>) != <span class="hljs-number">0</span>)
        {
            entry = entry.bitwiseAnd(<span class="hljs-number">-16</span>);
            <span class="hljs-keyword">let</span> callback = u64(entry.add(<span class="hljs-number">8</span>));
            log(\t${exec(.printf <span class="hljs-string">"%y"</span>, ${callback}).First()});
        }
    }
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">CallbackEnumerator</span>(<span class="hljs-params"></span>)
</span>{
    ParseCallbacks(<span class="hljs-string">"PspCreateProcessNotifyRoutine"</span>, <span class="hljs-number">64</span>);
    ParseCallbacks(<span class="hljs-string">"PspCreateThreadNotifyRoutine"</span>, <span class="hljs-number">64</span>);
    ParseCallbacks(<span class="hljs-string">"PspLoadImageNotifyRoutine"</span>, <span class="hljs-number">8</span>);
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">initializeScript</span>(<span class="hljs-params"></span>)
</span>{
    <span class="hljs-keyword">return</span> &#91;<span class="hljs-keyword">new</span> host.apiVersionSupport(<span class="hljs-number">1</span>, <span class="hljs-number">7</span>),
            <span class="hljs-keyword">new</span> host.functionAlias(CallbackEnumerator, <span class="hljs-string">"callbacks"</span>)];
}
</code></span></pre><br />
<br />
<strong>The result is in the screenshot. </strong>Modern WinDbg allows you to heavily automate the reverse engineering process, and an experienced analyst surely has a set of frequently used scripts.<em>
</em><br />
<span class="hashtag">#avlab</span> <span class="hashtag">#sandboxteam</span> <span class="hashtag">#tips</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
