Skip to main content

When the Exchange server becomes an "insider": Analyzing the Cereal campaign by Russian hackers

Updated 16 min readMarkdown
Part of seriesNewsletters-eng
When the Exchange server becomes an "insider": Analyzing the Cereal campaign by Russian hackers

Campaign Overview

At a government agency in the Eastern Bloc, a diplomatic specialist sent a top-secret email to a colleague at NATO headquarters. Mail passes through the Microsoft Exchange server smoothly, without delay, without a warning from the monitoring system. The administrator runs the Get-TransportAgent command — everything is clean. The SOC team checks the firewall — there aren't any outbound connections to the outside. Decompilers load the library in question into dnSpy — the decompiler only displays harmless empty methods.

However, all mail content and sensitive attachments were secretly copied and encrypted right at the transfer station before leaving the building.

That is the reality that the APT intelligence group Turla (Snake, Uroburos) created through a new weapon set called Cereal. Without needing an external C2 server, without registering any malicious configuration to Exchange, and abusing the darkest corners of the .NET specification (from VTable Fixups to Native Image Cache), Cereal turned the victim's email server itself into a perfect "passive intelligence station".

How can a group of hackers manipulate the EdgeTransport.exeprocess right in RAM without leaving a trace on disk? What mechanism allows unmanaged code to run before the .NET virtual machine? The entire technical anatomy series below will dissect how Turla set up one of the most sophisticated espionage campaigns on the Microsoft Exchange ecosystem.

Hacker Profile

Origins, aliases and intelligence connections (FSB Center 16)

  • Host unit: According to a joint statement from Western security agencies (CISA, FBI, NSA) and analysis from Brandefense, Turla is directly attributed to Center 16 of the Russian Federal Security Service (FSB - Federal Security Service), stationed at the Ryazan military unit (Military Unit 71330). On July 14, 2026, the European Union (EU) also officially placed the FSB's 16th Center unit on the sanctions list for its activities in operating cyber espionage groups including Turla.
  • Time of operation: Continuously active from the early 2000s (around 2003–2004) until now — spanning more than two decades of professional cyber weapons development.
  • Rich identifier & Alias system:
    • Cyber security industry: Snake, Uroburos, Waterbug, Venomous Bear, Secret Blizzard (Microsoft), KRYPTON, IRON HUNTER, Pacifier APT.
    • Official tracking codes: MITER G0010, UNC4210, ITG12, TAG_0530, Group 88, Blue Python, Hippo Team, MAKERSMARK, Pfinet, Popeye, SIG23, SUMMIT, WRAITH, UAC-0003, UAC-0024, UAC-0144.

Strategic Motivation & Target Portrait (Victimology)

Unlike cybercriminal groups seeking financial profits from ransomware or card data theft, Turla's motive is purely long-term strategic cyber espionage (Strategic Cyber Espionage) to directly serve the geopolitical ambitions, national security and foreign policy of the Kremlin:

  • Key target industry:
    • Ministries of foreign affairs, defense ministries and government administrative agencies.
    • Diplomatic missions, embassies and consulates worldwide.
    • Defense and aerospace industry contractors.
    • Scientific research organizations, strategic policy institutes, high technology and pharmaceuticals.
    • Critical infrastructure operating units (Critical Infrastructure).
  • Geographic scope: Turla's espionage activities have been recorded in more than 50 countries. The focus throughout is on NATO and European Union (EU) member states, extending to the United States/North America, the Middle East and the Central Asian countries of the former Soviet bloc.

Typical combat campaigns (2004 - 2026)

  • 2008 – 2014 (Snake Era & Attack on the US Department of Defense): Successfully penetrated the top secret military network of the US Central Command (US CENTCOM) via USB infected with Agent.BTZ malware; Deploying the Snake rootkit on a large scale in Europe.
  • 2015 – 2017 (Operation Carbon Diplomacy & DVB Satellite): Hacked top diplomatic missions in the Middle East and Eastern Europe by routing C2 through satellite dishes.
  • 2018 – 2020 (Operation Kazuar & Telecom Target): Penetrate major telecommunications carriers in Central Asia and Europe to monitor communications traffic of key individuals.
  • 2023 (Operation Medusa - Five Eyes took down Snake): In May 2023, the US Department of Justice and the Five Eyes alliance announced the successful destruction of the global Snake network using the FBI's specialized PERSEUS tool.
  • 2024 – 2026 (Restructuring & Operation Cereal): Quickly recovering from the 2023 takedown, Turla upgrades the Snake variant, enhances VPN device exploits, and launches the Cereal toolkit to fully control the Exchange mail flow of Eastern European government agencies.

Kill Chain

The attackers built a tightly orchestrated deployment chain that makes maximum use of native Windows and Exchange Server components, so that they leave as few foreign traces on disk as possible:

  1. Initial Access: Exploitation of known Exchange vulnerabilities, or use of previously stolen administrator accounts.
  2. Activation and Foothold (Persistence via DLL Hijacking): The CerealLoader file is planted in Windows Management Instrumentation (WMI) auto-load paths such as C:\Windows\System32\wbem\ncobjapi.dll, or injected into Exchange's NGEN cache.
  3. Execution While Bypassing Monitoring (Defense Evasion): The VTable Fixups technique allows native code to run before the .NET CLR virtual machine is loaded.
  4. Covert Control Channel (Passive Command Ingress): CerealNeuron listens directly on Exchange's HTTPS port 443, without opening additional ports or making outbound connections.
  5. Mail Flow Injection (Process Injection): The CerealIron injector is used to inject CerealBox into the EdgeTransport.exe process.
  6. Privileged Data Collection (Collection): The malware tampers with Transport Agents in memory, filters emails that match a target list, and saves them to temporary encrypted files.
  7. Exfiltration: Extraction commands from the operator are delivered through CerealNeuron; the malware reads the encrypted email packages and deletes the files once the operation completes.

Technical Architecture Analysis of the Cereal Toolkit

The name Cereal reflects the toolkit's extensive abuse of the Serialization mechanism in the .NET platform: the process of packaging data structures and executable code into byte streams so they can be transported and reconstructed directly in memory.

Overview of Cereal's 8-Module Ecosystem

The Cereal ecosystem is highly modular. Only one module appears on disk as an unencrypted PE file; all other components reside inside encrypted containers:

Module Name Format Execution Method Primary Function
CerealLoader .NET DLL DLL Hijacking / WMI / NGEN Loads code, exploits VTable Fixups, decrypts the other modules
CerealNeuron In-memory .NET IIS process (w3wp.exe) Passive backdoor that captures disguised HTTP web requests
CerealRunner In-memory .NET Managed memory Packages and executes one-off programs (disposable commands)
CerealSprinter In-memory .NET Managed memory Auxiliary loader that decrypts embedded (nested) binaries
CerealHermit In-memory .NET File-based / offline Offline, network-less C2 variant that reads commands from files on disk
CerealIron In-memory PE Native-to-managed bridge Injector that loads .NET assemblies into non-.NET processes
CerealBox In-memory .NET Injected into EdgeTransport.exe Intercepts email by wrapping Transport Agents in memory
CerealMoth In-memory .NET Managed reflection Loads assemblies and invokes the method specified by parameters

CerealLoader: Breaking the .NET Analysis Workflow with VTable Fixups

The first unusual aspect of CerealLoader is its binary structure. Normally, a .NET assembly is compiled into Microsoft Intermediate Language (MSIL), an intermediate code format. However, when a decompiler such as dnSpy, ILSpy, or dotPeek opens the CerealLoader file, the decompiler interface shows only a completely empty Entry Point method with no malicious behavior at all.

To achieve this, Turla abused the VTable Fixups feature defined in the ECMA-335 standard of the .NET Framework:

  • The VTableFixups field in IMAGE_COR20_HEADER stores a list of virtual pointer tables. This feature was originally designed to support calls back and forth between unmanaged C++ and managed C# code (C++ Interop).
  • When the Windows loader (ntdll!LdrpCallInitRoutine) loads this DLL, the VTable Fixups table is processed before the CLR activates regular managed functions.
  • The raw unmanaged code in this section executes immediately. It locates the encrypted payload file hidden on disk, decrypts it into memory, allocates a new memory region, and jumps directly into the malicious code.
  • A static analyzer that relies only on analyzing .NET IL bytecode will completely miss this native-code execution stage.

Deceiving the Process via the Native Image Cache (NGEN)

To speed up application startup, Windows maintains the Native Image Generator (NGEN) mechanism. NGEN precompiles common .NET assemblies into machine code specific to the processor architecture and stores them in a system directory: C:\Windows\assembly\NativeImages_v4.0.30319_64\

When an application requests a library, the CLR searches the NGEN cache first. If it finds a matching .ni.dll file, it loads that precompiled version instead of the original IL file, which saves JIT-compilation time.

Turla dropped the CerealLoader file into this cache directory under the name Microsoft.Exchange.Search.Mdb.ni.dll.

When the Exchange Search Service (Microsoft.Exchange.Search.Service.exe) requests the Microsoft.Exchange.Search.Mdb.dll module, the CLR automatically loads Turla's malicious .ni.dll file. Because this file does not contain functions that replace Exchange's full logic, the CLR automatically falls back to loading Microsoft's original library once the malware's unmanaged initialization routine has finished. As a result, the Exchange Search service continues to run normally, while Turla's hidden process has been successfully activated.

CerealNeuron: The Art of Controlling a Server Without Outbound Traffic

The traditional Command and Control model has always been malware's fatal weakness: periodic beacon connections to the Internet are eventually detected by network detection and response (NDR) systems, perimeter firewalls, or DNS gateways, and then added to blocklists.

CerealNeuron completely eliminates this weakness by operating as a Passive HTTP Backdoor:

The malware hooks directly into the IIS process that serves Exchange services (w3wp.exe) and silently intercepts requests sent to disguised URL paths:

  • /owa/sdds/ (disguised as an Outlook Web App path)
  • /AUTODISCOVER/PROXYSERVICE/ (disguised as the Autodiscover protocol)
  • /MICROSOFT-SERVER-ACTIVESYNC/INTEGRATED/API/ (disguised as mobile ActiveSync traffic)

CerealNeuron's authentication and response workflow:

  • When a request arrives at one of the URIs above, CerealNeuron checks the data structure, decrypts it with a secret key, and verifies the integrity checksum.
  • If authentication succeeds: The decrypted content is identified as a CerealRunner container. The malware unpacks it, executes the code in memory, packages the response output, encrypts it, and writes it into the HTTP response returned to the attacker.
  • If authentication fails (for example, a request from a scanner or a user clicking by mistake): The malware immediately redirects the connection or returns a standard Microsoft Exchange HTTP 404 or 500 error page. An administrator or an external WAF inspecting the traffic will treat it as an ordinary failed request.

CerealRunner & CerealSprinter: The "Disposable Executables" Concept

Instead of writing a bulky trojan with dozens of command menus that are easy to profile through behavioral analysis, Turla follows a "Disposable Programs" philosophy.

Reconnaissance tasks are broken down into independent .NET assembly files, each compiled specifically for a single operation:

  • Mailbox collection: Uses Exchange Web Services (EWS) to extract mailboxes or specific messages.
  • Active Directory reconnaissance: Queries user and computer objects, group permissions, and internal DNS records.
  • WMI queries: Enumerates running processes (Win32_Process) or open network connections (MSFT_NetTCPConnection).
  • Credential extraction: Reads LSA Secrets memory to collect system account passwords and Kerberos authentication tickets.
  • Disk data operations: Manages, compresses, and deletes the email files previously collected by CerealBox.

Once a command finishes executing, the entire assembly is unloaded from temporary memory, leaving no persistent binary traces on disk.

CerealBox: Hooking the In-Memory Exchange Transport Pipeline

In a Microsoft Exchange environment, every outgoing or incoming email must pass through the core transport process: EdgeTransport.exe.

To control mail flow, security solutions and third-party software typically use the Transport Agents feature. However, these transport agents must be registered in Exchange's configuration file and are publicly visible when an administrator runs the following command: Get-TransportAgent

Turla overcame this barrier with a technique never before seen in previous malware families:

  1. CerealIron injects code into the memory space of the EdgeTransport.exe process.
  2. CerealBox is loaded and uses Reflection to traverse Exchange's internal memory structures, identifying the legitimate Transport Agent objects currently running (for example, the system's default anti-spam or routing agents).
  3. The malware does not register a new agent. Instead, it directly replaces the function pointers (delegate wrapping) of the existing agents with CerealBox's malicious code.
  4. When a message passes through the pipeline, CerealBox's wrapper is invoked first:
    • It checks the sender/recipient list, specifically filtering for addresses related to NATO and European Union (EU) institutions.
    • It checks for attachments with the .doc, .docx, or .pdf extensions.
    • It matches keywords in the email subject line.
  5. If a message matches the targeting criteria, CerealBox clones the entire email content, compresses and encrypts it, and saves it to a temporary file on disk.
  6. Once finished, it calls the original handler function of the Transport Agent so the email continues to be delivered normally.

Result: Exchange's configuration remains completely clean, the Get-TransportAgent command shows no suspicious agents, and senders and recipients experience no errors or delays during message exchange.

  • CerealHermit: A variant of CerealNeuron with the HTTP networking module removed. It acts as an offline C2 channel: it reads commands from encrypted files dropped into a predefined directory on disk and writes its results back as encrypted files as well. This technique serves as a backup channel when the web channel is under control or monitoring.
  • CerealIron: Acts as a native injector. Because many system processes originally run as unmanaged code (C/C++), CerealIron is responsible for initializing an internal CLR hosting environment and loading managed .NET modules into these processes.
  • CerealMoth: A lightweight reflection utility that takes an assembly path and a specific method name, then triggers execution of that method in memory.

IOCs

SHA-1 Hash

  • 4A3C263977417FB6977B0E598C9E3BC5924F390C
  • 1408A8F62B09A5AD0DFF279B2878D8F59F70A330
  • 5D80118B1EE974936322475F740AB3AEFF70B8F3
  • 3D1A534CE0D0C293F62ECE556CBC6D0728213104
  • 5B94FE76EC4FEB0B5CB6EA3BCA4C48D2FE22597B
  • 7AB784D0049890D9844AEE7F214BA173E3CC23BE
  • 7742C6B0AAF114335CEF7EBAB11290CB18A0B8B3
  • AFE448DD95494CD14438F04F0C5F6B384664A3B7
  • 4A65040646E354303F067D47AA1C953D467F65CB
  • D1E17520A2435EDCDCC47F582381416FBDF75F94
  • D51C58C2E95D4561848E0A5A8B9FB33C847C50A4
  • AD85FBF2CC879D4325BCE1E6FB5F12AB59E3D387
  • 3EA03188DBA8898D97E965732C1D6A68C5437EDC
  • 3FBA18AF966DEACF7AE09E4D4238952DD90A6D6F
  • EB9BA1DA5363F5D04E2F98673595FCE93F39A78E
  • 0B4E4A1CE7FEE91BFC62B2A2EC572C325642BB60
  • A4E477CE257F2C635401EF554E05506C080967C0
  • A5BE8706032A0798FD63214A9F22EFA6309355F5

MITRE ATT&CK

Tactic Technique ID Technique Name Description of Technique Behavior in the Campaign
Persistence / Privilege Escalation T1574.002 Hijack Execution Flow: DLL Side-Loading Planted CerealLoader masquerading as ncobjapi.dll and wbemcomn.dll in the wbem directory.
Defense Evasion T1027 Obfuscated Files or Information All binary modules are heavily encrypted and decrypted in-memory.
Defense Evasion T1112 Modify Registry / Native Cache Abuse Tampered with the NGEN cache to stealthily execute code via .ni.dll files.
Defense Evasion / Execution T1055 Process Injection Used CerealIron to inject malicious code into the EdgeTransport.exe process.
Persistence / Defense Evasion T1505.004 Server Software Component: IIS Components Installed the passive backdoor CerealNeuron, listening directly on IIS.
Credential Access T1003.004 OS Credential Dumping: LSA Secrets The CerealRunner command extracts LSA credentials from memory.
Discovery T1087.002 Account Discovery: Domain Account Queried the Active Directory structure to enumerate user accounts and groups.
Discovery T1049 System Network Connections Discovery Queried the WMI class MSFT_NetTCPConnection to inspect network connections.
Collection T1114.002 Email Collection: Remote Email Collection Hooked into the Exchange Transport Pipeline to intercept emails with .doc, .docx, and .pdf attachments.
Command and Control T1071.001 Application Layer Protocol: Web Protocols Used HTTP POST over port 443, disguised as OWA/ActiveSync URIs.

Expert Comments

The emergence of the Cereal toolkit marks a strategic shift in the operational tradecraft of the Turla APT group. The FPT IS SOC security analysis team draws three key conclusions:

Neutralizing the Outbound Detection model: Most security operations centers (SOCs) today focus their monitoring on outbound traffic, hunting for periodic beaconing patterns, DNS tunneling, or TLS connections to external IPs and domains. The Cereal campaign shows that nation-state attackers are willing to abandon external C2 infrastructure entirely. By turning the victim's own server into a passive C2 node (Passive Ingress), the attackers blend malicious traffic completely into tens of thousands of legitimate web connections. If a SOC lacks the capability to decrypt internal SSL/TLS traffic and deeply inspect the URI structure of POST requests, its network defenses will be completely "blind."

The pinnacle of Windows and .NET internals abuse: Exploiting the VTable Fixups feature to deceive decompilers and injecting code into the Native Image Cache (NGEN) reveal a highly sophisticated malware development capability. Turla does not simply rely on public tools; it digs deep into Microsoft's technical documentation to find obscure "gray areas" that few would expect. In particular, the wrapper delegate technique applied to Transport Agents in the memory of EdgeTransport.exe is an innovative configuration-evasion method: it renders all standard administrative configuration checks meaningless.

Practical lessons for organizations in Vietnam: Many government agencies, state-owned corporations, and financial institutions in Vietnam still run on-premises Microsoft Exchange servers (or a hybrid deployment with Exchange Online). Most of these organizations stop at applying periodic security patches (Cumulative Updates/Security Updates) and have no capability for runtime memory inspection of server processes. If attackers have already obtained administrative privileges, vulnerability patches cannot remove in-memory backdoors such as Cereal.

Recommendations for Response Action

Immediate (0–24 hours)

  • Verify WMI directory integrity: Immediately scan the C:\Windows\System32\wbem\ directory and check the digital signatures of ncobjapi.dll and wbemcomn.dll. Isolate any file without a genuine Microsoft digital signature for analysis right away.
  • Review IIS access logs: Run queries across all IIS log files from the last 90 days for POST requests targeting /owa/sdds/, /AUTODISCOVER/PROXYSERVICE/, and /MICROSOFT-SERVER-ACTIVESYNC/INTEGRATED/API/.
  • Monitor EdgeTransport process activity: Watch for abnormal file read/write behavior by EdgeTransport.exe, especially temporary files that grow sharply in size in directories outside the standard Exchange configuration.

Short-term (1–7 days)

  • Inspect process memory (memory dump): Dump the memory of EdgeTransport.exe on Edge/Mailbox servers and use analysis tools (such as WinDbg or Volatility plugins) to look for abnormal delegate hooks on email-processing functions.
  • Verify digital signatures of NGEN libraries: Review the entire C:\Windows\assembly\NativeImages_v4.0.30319_64 directory to confirm that no .ni.dll library has been illegitimately replaced or overwritten.
  • Configure WAF/reverse proxy: Deploy hard block rules on the WAF or reverse proxy in front of Exchange for all requests to the disguised URIs identified in this campaign.

Long-term

  • Deploy Windows Defender Application Control (WDAC): Enforce a strict application control policy across all Exchange servers that blocks loading of any DLL that is not signed by Microsoft or not on the allowlist.
  • Adopt advanced memory monitoring (EDR with memory scanner): Upgrade to EDR solutions that can scan heap/stack memory regions in real time to detect unmanaged-to-managed code injection techniques.
  • Email infrastructure modernization roadmap: Assess the security risk of self-managed on-premises Exchange clusters, then gradually migrate to high-security cloud platforms, or fully separate the external mail-receiving servers (Edge Transport) from sensitive data network zones.

References

Turla hackers use new Cereal malware to spy on govt Exchange servers

Exchange for breakfast: Turla’s Cereal tricks are not for kids

Russian Turla Hackers Use New Cereal Malware to Steal Emails From Government Exchange Servers

Turla APT Deploys Cereal Malware Toolset

No comments yet. Be the first to comment.

More from this blog