Kaspersky Details NetamLoader XAML Chain Targeting Custom Asian Government Windows Build

· Original article ↗

Summary

Kaspersky detailed NetamLoader, a multi-stage .NET/XAML loader that abuses deserialization and AMSI, runs through a Patch My PC process, and communicates with C2. KSN telemetry showed one Asian victim; attribution remains unknown.

Key points

  • Kaspersky traced the infection chain from a CAB archive in the Windows update-download directory; it did not determine how the archive reached the victim.
  • A crafted .config file and fabric.config trigger AppDomainManager loading, BinaryFormatter deserialization, a TypeConfuseDelegate attack, and successive XAML payloads.
  • The loader hijacks the AMSI scan path, disables .NET ETW provider registration, and moves execution into dllhost.exe through a remote COM object.
  • The malware removes files, logs, Prefetch data, and registry records to hinder forensic analysis.
  • The .NET plugin gathers Windows and .NET version information, detects system proxies, and communicates with openaigpt4v[.]com using AES-CBC with HMAC.
  • The configured malware delays its first C2 connection by 20–40 minutes and polls at long intervals when the server does not respond.
  • KSN telemetry identified one victim in Asia. Kaspersky inferred government targeting from the customized Windows build, but did not establish how the malware was delivered or attribute it to a known APT group.

Article Details

Attack Vectors
  • The CAB archive’s delivery method was not observed. Its placement in the Windows update package directory and the infection chain led researchers to say a supply-chain attack was strongly indicated; the suspected target was a customized government-only Windows build in Asia.
  • PatchMyPC-ScriptRunner.exe loads an assembly through AppDomainManager injection using its accompanying configuration file. A crafted fabric.config loads Resources.resx, whose serialized payload triggers BinaryFormatter deserialization and a TypeConfuseDelegate chain that parses embedded XAML.
  • The framework decodes, decompresses, and decrypts layered XAML and .NET payloads, then uses RPC/COM and an object-deserialization exploit to load XAML-3 into dllhost.exe.
  • XAML-2-1 patches the AMSI scan method so scans return AMSI_RESULT_CLEAN. The loader also sets COMPlus_ETWEnabled to 0 to prevent CLR ETW provider registration.
  • The .NET 2 Plugin communicates with its C2 server over HTTPS, encrypts traffic using AES-128-CBC with HMAC, discovers system proxy settings, and retrieves XAML payloads. It delays the initial C2 connection by 20–40 minutes.
Defensive Notes
  • Kaspersky products detect the threat as HEUR:Trojan.MSIL.NetamLoader.gen, Trojan.MSIL.Zapchast.*, and Trojan.Script.Agent.*.
  • The loader removes stage-one files, CLR usage logs, Prefetch files, and update-related records, and filters Windows log files for lines containing GetExtendedUpdateInfoHandler.

Indicators of compromise

TypeIndicatorContext
DOMAINopenaigpt4v[.]comDomain identified in the article as the malware’s C2 server.
MD54f28622c5e60c01319bf48cf742fe1a5Hash of XAML-2-2, which loads the .NET 1 Loader and C2 configuration.
MD5514117d536e347560d049cfe0c609632Hash of XAML-1, a loader in the malicious infection chain.
MD5514ac0d73b8a1b73488ef5e2e55a75c3Hash of PatchMyPC-ScriptRunner.exe.config, used to trigger AppDomainManager injection.
MD567e3617f8709d34f806f8e02badba8a5Hash of fabric.config, which is crafted to load the malicious Resources.resx content.
MD59000820d8153c24cd60d53001d3a97b6Hash of XAML-2, which initiates stage 2 of the infection.
MD5ab81564bcb8ca7e710c66832de747556Hash of the .NET 1 Loader component of the malicious framework.
MD5b3c4a635179680edafb5d006cf0cffc6Hash of XAML-2-1, which patches AMSI scanning.
MD5c86d53392a87dd3f3e62d62c9b92a9bdHash of XAML-3, the payload loaded into dllhost.exe.
MD5cfb8b281bdf5d9390e64b10c312fb2c1Hash of the .NET 2 Plugin loaded by the malicious framework.
MD5e1dc6f1ed193594f2284be22ae08dfa4Hash of Resources.resx, which contains the serialized payload used in the infection chain.
MD5f2458ed133f8d0ca19e22c10f577e98eHash listed for the CAB archive found in the Windows update download directory.
URLhxxps[:]//openaigpt4v[.]com/model_v4/94aafd58-c00c-402a-aae6-858b4486a1a4?b=lM4V3VwrWtXBy4oBGUkXOHfxyLUlrT2hIZGn4C37W1Z3%2FeW1WURJqzaNLQhGFHsWxA2lpJHZSpd8VDLMOQRD%2FfsDswnomIrBpoaNzug3dOtrh1J2KIqZRmKx1TtQsxq1RAGu1y45rSKaPHm9s2HF8A%3D%3D&c=41bd7f37-c3f6-4a9e-b2f3-5363e9a2c095Specific C2 polling URL shown in the article as the malware’s final HTTP request URL.

MITRE ATT&CK

T1016 · System Network Configuration DiscoveryThe plugin discovers system proxy settings through WinHTTP, an explorer.exe user context, and the .NET default proxy.T1027 · Obfuscated Files or InformationPayloads are layered, compressed, encrypted, Base64-encoded, and have sensitive strings split into fragments.T1057 · Process DiscoveryThe plugin locates the running explorer.exe process to retrieve its proxy configuration.T1070.004 · File DeletionThe .NET 1 Loader deletes stage-one files, CLR usage logs, and Windows Prefetch files to remove forensic artifacts.T1071.001 · Web ProtocolsThe malware uses HTTPS requests to communicate with its C2 server and retrieve XAML payloads.T1082 · System Information DiscoveryThe .NET 2 Plugin queries registry values for the .NET version and Windows BuildLab to collect system information.T1105 · Ingress Tool TransferThe plugin retrieves XAML payloads from the C2 server for execution.T1112 · Modify RegistryThe loaders delete generated registry subkeys used for exception-state logging and create a DllSurrogate registry value.T1134.001 · Token Impersonation/TheftThe plugin impersonates the explorer.exe access token to retrieve that process’s proxy configuration.T1140 · Deobfuscate/Decode Files or InformationThe loaders decode Base64 data, decompress ZIP content, and decrypt AES-protected XAML and other payloads.T1497.003 · Time Based ChecksThe plugin delays its initial C2 connection by a configured 20–40 minutes to evade sandboxes.T1562.001 · Disable or Modify ToolsXAML-2-1 patches the AMSI scan method so that scans return AMSI_RESULT_CLEAN.T1573.001 · Symmetric CryptographyC2 traffic is encrypted using AES-128-CBC with HMAC-based authentication.T1574.014 · AppDomainManagerPatchMyPC-ScriptRunner.exe loads an assembly through AppDomainManager injection configured by its accompanying .config file.T1620 · Reflective Code LoadingThe loader decodes a .NET assembly payload and loads the .NET 2 Plugin into the current domain.

Malware

Vendors

Products

Industries

Related Articles