Executive Summary
Kaspersky's Global Research and Analysis Team (GReAT) has identified a sophisticated multi-stage malware framework named NetamLoader, designed to target a customized Windows 10 operating system believed to be used exclusively by government entities in Asia.
The infection chain abuses legitimate Microsoft-signed .NET assemblies, AppDomainManager injection, a crafted configuration file, and a malicious RESX resource file to initiate execution. The malware subsequently loads multiple encrypted and compressed XAML payloads, bypasses the Antimalware Scan Interface (AMSI), removes forensic artifacts, and transfers execution into dllhost.exe.
NetamLoader communicates with attacker-controlled infrastructure through encrypted HTTPS connections using Cloudflare-hosted infrastructure. It also introduces a 20–40-minute delay before its initial C2 communication to make sandbox-based analysis more difficult.
Kaspersky identified a single victim in Asia through its telemetry. The researchers could not attribute the activity to any known APT group. The targeting characteristics suggest a government-focused cyber-espionage operation, although the initial delivery mechanism remains unknown.
Description
NetamLoader is an advanced .NET-based malware loading framework that uses legitimate Windows and Microsoft software components to conceal malicious execution.
The investigation began after Kaspersky Security Network detected a suspicious .config file that used AppDomainManager injection to load an arbitrary .NET assembly. The file was packaged inside a CAB archive located in the Windows Update download directory:
C:\Windows\SoftwareDistribution\Download\
The archive contained several files that appeared legitimate, including components associated with the Patch My PC patch management tool and Microsoft-signed .NET assemblies. However, the accompanying configuration and resource files were carefully crafted to initiate a multi-stage execution chain.
The researchers found that the malware uses a combination of .NET deserialization, XAML-based payload execution, AES encryption, AMSI manipulation, and COM-based process execution to maintain stealth and evade endpoint security monitoring.
Kaspersky named the framework NetamLoader. Its products detect related components under the following detection names:
HEUR:Trojan.MSIL.NetamLoader.genTrojan.MSIL.Zapchast.*Trojan.Script.Agent.*
Technical Details
Malware Name: NetamLoader
Malware Type: Multi-stage .NET Loader
Target Operating System: Customized Windows 10 government build
Target Region: Asia
Suspected Target Sector: Government
Initial Execution Technique: AppDomainManager Injection
Payload Format: XAML, .NET assemblies, JSON
Execution Mechanism: .NET deserialization and XAML loading
Defense Evasion: AMSI bypass, log cleanup, Prefetch deletion, process-tree separation
Command and Control: Encrypted HTTPS
C2 Infrastructure: Cloudflare-hosted domain
Attribution: Unknown APT group
Observed Victims: One victim identified by Kaspersky telemetry
Initial Infection and Delivery
The initial malicious package was discovered as a CAB archive stored in the Windows Update download directory:
C:\Windows\SoftwareDistribution\Download\e4537a1762fcafd2fd96bfc825bad34f9db9a24d
The archive contained seven files that were extracted into:
C:\Windows\SoftwareDistribution\Download\Install\
The execution involved the following process and command-line pattern:
PatchMyPC-ScriptRunner.exe -updatepackage -applicationid=<GUID>
The researchers did not observe how the CAB archive was originally delivered to the victim. Therefore, the initial access or delivery mechanism remains unconfirmed.
Stage 1: AppDomainManager Injection
The first stage begins when PatchMyPC-ScriptRunner.exe executes alongside a specially crafted configuration file:
PatchMyPC-ScriptRunner.exe.config
The configuration file specifies the following Microsoft-signed assembly:
Microsoft.HostIntegration.Connectors.dll
It also defines the class:
Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration
This class is associated with Windows Server AppFabric Cache Client configuration functionality.
Through AppDomainManager injection, the malicious configuration causes the signed assembly to load before the host application's main function executes.
The assembly subsequently reads a crafted fabric.config file, which references a resource file named Resources.resx.
Stage 2: .NET Deserialization and XAML Execution
The Resources.resx file contains a Base64-encoded serialized binary object created using the .NET BinaryFormatter class.
When the resource file is parsed, the embedded object triggers BinaryFormatter.Deserialize(), enabling a TypeConfuseDelegate technique that invokes:
XamlReader.Parse()
This results in the execution of the first malicious XAML payload, identified as XAML-1.
XAML is normally used for defining user interfaces in .NET applications. However, the malware abuses built-in .NET objects such as ObjectDataProvider and ResourceDictionary to execute logic equivalent to application code.
The first XAML payload decrypts the next stage using an AES key derived from the SHA-256 hash of the host process's command line.
This approach ties payload decryption to the original execution context, making independent sandbox replay and analysis more difficult.
Stage 3: Multi-Layer XAML Payloads
The next stage contains additional XAML payloads embedded as compressed and Base64-encoded data.
Kaspersky identified multiple components:
XAML-2: Loads the next execution stage.
XAML-2-1: Responsible for bypassing AMSI.
XAML-2-2: Loads the first .NET loader and its associated JSON configuration.
.NET 1 Loader: Processes configuration data, decrypts subsequent payloads, and prepares execution.
XAML-3: Loads the final payload into a separate process.
.NET 2 Plugin: Performs the main malicious operations and C2 communications.
Each layer extracts, decrypts, and loads the next component in memory, reducing the need to expose the complete malware chain as files on disk.
Stage 4: AMSI Bypass
One of the XAML payloads specifically targets the Windows Antimalware Scan Interface (AMSI).
The malware reconstructs sensitive strings from fragmented values and manipulates AMSI-related memory structures to interfere with scanning.
The implementation modifies the AMSI scanning method so that subsequent scan operations return:
AMSI_RESULT_CLEAN (0)
This allows malicious content to evade normal AMSI inspection within the affected process.
Stage 5: Forensic Artifact Removal
After preparing the next execution stage, the loader attempts to remove evidence of its initial execution.
Reported cleanup activity includes:
Removing malicious files extracted from the CAB archive.
Deleting related Windows update records from system logs.
Removing CLR usage logs.
Deleting Windows Prefetch files associated with
PatchMyPC-ScriptRunner.exe.Modifying log files under the custom
CmitUpdateAgentdirectory to remove entries containingGetExtendedUpdateInfoHandler.Deleting registry subkeys associated with its exception-state logging mechanism.
The cleanup activity is designed to reduce forensic visibility and make reconstruction of the original execution chain more difficult.
Stage 6: Execution Inside dllhost.exe
The malware uses a COM-based execution technique to move its final payload outside the original process tree.
It creates a remote COM object through RPC and abuses a binary object deserialization issue with the TypeConfuseDelegate technique.
The resulting XAML-3 payload is loaded into:
dllhost.exe
The malware also sets the following environment variable:
COMPlus_ETWEnabled=0
This prevents the CLR from registering its .NET Event Tracing for Windows (ETW) provider, reducing visibility into managed-code activity.
By separating the malicious execution from the original PatchMyPC process, NetamLoader makes process-tree-based detection more difficult.
Stage 7: Command-and-Control Communication
NetamLoader communicates with its C2 infrastructure using encrypted HTTPS requests.
The malware uses the following domain:
openaigpt4v[.]com
The communication uses AES-128-CBC encryption with HMAC-SHA256 for authentication and integrity protection.
The malware also attempts to identify the system's proxy configuration through multiple methods, including WinHTTP APIs and .NET proxy settings. This helps it maintain external connectivity in environments that use enterprise proxy infrastructure.
Kaspersky identified the following communication characteristics:
Initial C2 communication is delayed by approximately 20–40 minutes.
Successful C2 responses are followed by polling intervals of approximately 5–6 minutes.
When the C2 server does not respond, the malware uses substantially longer polling intervals of approximately 22–28 hours.
Downloaded XAML payloads are executed in isolated .NET AppDomains and unloaded after execution.
The initial delay is particularly relevant for sandbox detection because automated analysis environments may terminate or classify a sample before its first external communication occurs.
Attack Chain Overview
A malicious CAB archive is placed in the Windows Update download directory.
PatchMyPC-ScriptRunner.exeexecutes with a malicious configuration file.AppDomainManager injection loads a Microsoft-signed .NET assembly.
A crafted
fabric.configreferences the maliciousResources.resxfile..NET deserialization triggers the first XAML payload.
Multiple encrypted and compressed XAML layers are loaded.
AMSI is manipulated to bypass malware scanning.
Logs, Prefetch entries, and other forensic artifacts are removed.
The final payload executes inside
dllhost.exe.Encrypted HTTPS communication is established with the C2 infrastructure after a 20–40-minute delay.
Indicators of Compromise (IOCs)
The following indicators were published by Kaspersky Securelist.
Network Indicators
| Indicator | Type | Description |
|---|---|---|
openaigpt4v[.]com | Domain | Command-and-control infrastructure |
104.18.14[.]219 | IPv4 | Cloudflare-associated IP address reported for the C2 domain |
Note: The IP address belongs to Cloudflare infrastructure. Avoid blocking the shared IP address without validating the destination and associated traffic. Domain-based monitoring and context-aware investigation are recommended.
File Hashes (MD5)
| File | MD5 Hash |
|---|---|
| Initial CAB archive | F2458ED133F8D0CA19E22C10F577E98E |
| Resources.resx | E1DC6F1ED193594F2284BE22AE08DFA4 |
| .NET 1 Loader | AB81564BCB8CA7E710C66832DE747556 |
| .NET 2 Plugin | CFB8B281BDF5D9390E64B10C312FB2C1 |
| fabric.config | 67E3617F8709D34F806F8E02BADBA8A5 |
| PatchMyPC-ScriptRunner.exe.config | 514AC0D73B8A1B73488EF5E2E55A75C3 |
| XAML-1 | 514117D536E347560D049CFE0C609632 |
| XAML-2 | 9000820D8153C24CD60D53001D3A97B6 |
| XAML-2-1 | B3C4A635179680EDAFB5D006CF0CFFC6 |
| XAML-2-2 | 4F28622C5E60C01319BF48CF742FE1A5 |
| XAML-3 | C86D53392A87DD3F3E62D62C9B92A9BD |
File Paths
Review the following paths for unexpected files or modifications:
C:\Windows\SoftwareDistribution\Download\e4537a1762fcafd2fd96bfc825bad34f9db9a24dC:\Windows\SoftwareDistribution\Download\Install\PatchMyPC-ScriptRunner.exe.configC:\Windows\SoftwareDistribution\Download\Install\fabric.configC:\Windows\SoftwareDistribution\Download\Install\Resources.resx
Additional forensic locations:
%LOCALAPPDATA%\Microsoft\CLR_v4.0\UsageLogs\PatchMyPC-ScriptRunner.exe.log%WINDIR%\Prefetch\PATCHMYPC-SCRIPTRUNNER.EXE-*.pf%WINDIR%\Logs\CmitUpdateAgent\20????\20??????
Additional Hunting Artifacts
Process:
PatchMyPC-ScriptRunner.exeProcess:
dllhost.exeEnvironment variable:
COMPlus_ETWEnabled=0Configuration reference:
Microsoft.HostIntegration.Connectors.dllConfiguration class:
Microsoft.ApplicationServer.Caching.DataCacheFactoryConfigurationAMSI-related CLSID:
{fdb00e52-a214-4aa1-8fba-4357bb0072ec}C2 URI pattern:
/model_v4/
Potential Impact
Successful execution of NetamLoader may result in:
Stealthy malware execution: Abuse of trusted Microsoft-signed assemblies and legitimate patch-management components can make malicious activity appear routine.
Defense evasion: AMSI manipulation and ETW suppression reduce visibility into malicious .NET execution.
Forensic evidence destruction: Removal of logs, Prefetch files, and registry artifacts complicates incident investigation.
Process-tree evasion: Execution inside
dllhost.exeseparates the final payload from its initial execution process.Persistent remote access: Encrypted C2 communications allow the malware to receive additional XAML payloads and instructions.
Government network compromise: The targeting of a customized government Windows build raises concerns about sensitive government infrastructure and information.
Kaspersky identified one victim in Asia. The research does not establish widespread compromise or identify a confirmed threat actor.
Recommendations
Hunt for published IOCs: Search endpoint, SIEM, DNS, proxy, and firewall telemetry for the published MD5 hashes, C2 domain, IP address, and file paths.
Review Windows Update directories: Inspect
SoftwareDistribution\Downloadand its subdirectories for unexpected CAB archives, configuration files, and resource files.Validate signed binaries: Do not assume that a Microsoft-signed executable or assembly is safe. Review the execution context, command-line arguments, associated configuration files, and parent-child process relationships.
Monitor AppDomainManager injection: Investigate unexpected
.configfiles containingappDomainManagerTypeandappDomainManagerAssemblyentries.Monitor suspicious .NET deserialization: Review unusual use of
BinaryFormatter.Deserialize(),ResXResourceSet, and XAML parsing in unexpected application contexts.Investigate AMSI and ETW tampering: Monitor suspicious memory modifications to AMSI-related functions and unexpected changes to
COMPlus_ETWEnabled.Monitor dllhost.exe execution: Investigate unusual network connections, suspicious memory activity, and unexpected .NET-related behavior originating from
dllhost.exe.Review forensic artifact deletion: Look for unexpected deletion of Prefetch files, CLR usage logs, Windows Update logs, and registry entries.
Monitor delayed C2 activity: Review outbound HTTPS traffic occurring 20–40 minutes after suspicious .NET loader execution, including requests to the reported C2 domain.
Review proxy and network telemetry: Investigate unusual proxy discovery, encrypted outbound connections, and recurring communication patterns from Windows system processes.
Preserve forensic evidence: If suspicious activity is identified, preserve relevant logs, memory, process information, and filesystem artifacts before attempting cleanup or remediation.
Conclusion
NetamLoader demonstrates how sophisticated malware can abuse trusted software components, .NET loading mechanisms, and legitimate Windows directories to conceal malicious execution.
Its combination of AppDomainManager injection, BinaryFormatter deserialization, layered XAML payloads, AMSI bypass, forensic artifact removal, and execution inside dllhost.exe presents significant challenges for traditional signature-based and process-tree-based detection.
Although Kaspersky identified only one victim, the targeting of a customized government Windows build and the complexity of the malware framework suggest a highly focused operation. Organizations should prioritize behavioral threat hunting, validate trusted binary execution, and monitor unusual .NET activity and outbound communications.
