DonutLoader
- Type
- Loader
- Capabilities
- Process injectionDefense evasion
- Delivery
- PhishingClickfixMalvertising
- Platforms
- Windows
DonutLoader is an open-source shellcode-generation and in-memory loading tool used in Windows malware execution chains. It packages .NET assemblies, DLLs, and native executables into position-independent shellcode that loads and executes embedded payloads in process memory, avoiding the need to write the final executable to disk. Its loading routines support payload decryption, decompression, and manual PE mapping. Observed deployments have erased PE headers, removed execution artifacts, and patched AMSI and ETW functions to reduce inspection and telemetry. DonutLoader shellcode is also deployed through process injection, including injection into Windows Explorer and other legitimate Windows processes.
DonutLoader has delivered information stealers, remote-access trojans, and backdoors, including Remus, Agent Tesla, QuasarRAT, CASTLESTEALER, and SPECTRALVIPER. Delivery chains incorporating it have used phishing attachments, fake-CAPTCHA ClickFix lures, malicious advertisements, and multistage script loaders. In the REF2754 intrusion campaign, it loaded SPECTRALVIPER during attacks against large Vietnamese companies, including agribusiness and financial-services organizations. Its use across unrelated campaigns reflects its role as a reusable payload-execution component rather than a tool exclusive to one threat actor. Credential theft, surveillance, and command-and-control functions generally belong to the payloads it loads rather than to DonutLoader itself.
Associated vulnerabilities
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
5 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
“Дешифрованные данные представляют собой шеллкод DonutLoader ... DonutLoader загружает и выполняет в памяти QuasarRAT.”
In parallel, the installer delivers PULSAR through RC4-encoded DonutLoader shellcode injected into explorer.exe.
The unsigned DLL (dbg.config) contained DONUTLOADER shellcode which it attempted to inject into sessionmsg.exe. DONUTLOADER was configured to load the SPECTRALVIPER backdoor, and ultimately the situationally-dependent P8LOADER or POWERSEAL malware families.
On Windows systems, the hack of the Telnyx Python SDK resulted in the deployment of an executable named "msbuild.exe" that employs several obfuscation techniques to evade detection and extracts DonutLoader, a shellcode loader, from a PNG image present within the binary to load a full-featured trojan and a beacon associated with AdaptixC2, an open-source command-and-control (C2) framework.
...Velvet Tempest ... used a ClickFix lure ... to drop payloads like DonutLoader and CastleRAT.
Techniques & procedures
46 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
2 techniques
Resource Development
The campaign appears to be spreading through malvertising, where attackers pay to place malicious links in search engine ads and sponsored results.
Threat actors may have also used SEO poisoning to further boost the site’s visibility in organic search results.
Initial Access
4 techniques
Initial Access
Many of the Keitaro IP addresses we saw in the AS214351 network host and distribute malware.
Cybersecurity analyst Louis Schürmann from Swiss Post Cybersecurity investigated an incident that began with a seemingly harmless email and developed into a multi-stage attack.
Stage 1: Email Delivery Victim receives spearphishing email with .JS attachment Lure themes: "Bill of Lading", "Vessel Particulars", "Urgent Inquiry For Quotation"
The user is directed to a malicious URL which presents a fake CAPTCHA.
Execution
12 techniques
Execution
Using the recovered values, the malware establishes persistence by registering a scheduled task named IntelDriver through the Windows schtasks utility, causing execution upon user logon.
First, social engineering was employed, followed by a PowerShell dropper, and finally an in-memory infostealer payload was delivered.
The reconstructed content is subsequently Base64-decoded and decrypted using a repeating XOR key (tk) before being executed through PowerShell's Invoke-Expression (IEX) mechanism.
The infection chain begins with a heavily obfuscated Windows batch script that conceals its functionality through variable substitution and control-flow obfuscation.
Scheduled-task persistence via a VBS launcher: The malware creates a scheduled task that executes a Visual Basic Script (VBS), ensuring it automatically runs again after a system reboot or user logon.
The malware uses a staged execution chain that moves from Python bytecode into shellcode... The persisted Python bytecode stage contains loader indicators
Stage 2: JavaScript Execution via WSH Double-click triggers WScript.exe (Windows Script Host) Script begins deobfuscation through 4-layer chain
The package is copied, marked as executable and launched in a new thread... the loader uses raw syscalls supplied by a small framework... Since all high-risk operations ... run through these handcrafted syscalls, standard API calls to monitor are never seen by common user-land EDR hooks.
It then uses DonutLoader shellcode to load the final .NET payload into memory, reducing evidence for scanners looking only for suspicious files.
This CAPTCHA instructs the user to execute a series of keyboard shortcuts (Win + R, Ctrl + V, Enter), which runs a PowerShell command previously copied to the clipboard by the website. | First, social engineering was employed... The initial point of entry is user-driven execution of a PowerShell command, delivered through a social engineering tactic known as ClickFix.
Current delivery methods include fake CAPTCHA “ClickFix” pages that trick victims into executing malicious PowerShell via the Windows Run dialog
Recent 2026 campaigns show Vidar delivered through malvertising leading to fake cracked-software downloads, and via trojanized GitHub repositories disguised as legitimate developer tools
Persistence
2 techniques
Persistence
Using the recovered values, the malware establishes persistence by registering a scheduled task named IntelDriver through the Windows schtasks utility, causing execution upon user logon.
The cryptographic loop identified at the end of the installation in persistence is a simple implementation of RC4 ... installs itself in persistence ... A “Run” registry key installing a Windows Security persistence can indicate an infection by the loader.
Privilege Escalation
5 techniques
Privilege Escalation
Using the recovered values, the malware establishes persistence by registering a scheduled task named IntelDriver through the Windows schtasks utility, causing execution upon user logon.
DONUTLOADER shellcode ... attempted to inject into sessionmsg.exe. SPECTRALVIPER can load and inject executable files.
MITRE ATT&CK Mapping Tactic Technique ID Application Execution Reflective Code Loading T1620 Donut decrypts + loads PE in-memory Defense Evasion Obfuscated Files: Embedded Payloads T1027.009 Chaskey-16 CTR encrypted Donut payloads Defense Evasion Masquerading: Legitimate Name T1036.005 Process named nsvchost.exe Defense Evasion Subvert Trust Controls T1553 Inline C# avoids pre-compiled AV detection Privilege Escalation Token Manipulation T1134.001 SeDebugPrivilege via AdjustTokenPrivileges Discovery Process Discovery T1057 CreateToolhelp32Snapshot for svchost.exe Lateral Movement Process Injection: DLL Injection T1055.001 VirtualAllocEx + WriteProcessMemory into svchost.exe
Python runtime abuse for Early Bird APC injection into suspended legitimate processes
The cryptographic loop identified at the end of the installation in persistence is a simple implementation of RC4 ... installs itself in persistence ... A “Run” registry key installing a Windows Security persistence can indicate an infection by the loader.
Stealth
19 techniques
Stealth
Analysis revealed multiple layers of obfuscation, including environment-variable substitution, dynamic command reconstruction, extensive control-flow flattening, and large volumes of junk REM, ECHO, and SET statements intended to hinder static analysis.
...extracts DonutLoader, a shellcode loader, from a PNG image present within the binary to load a full-featured trojan and a beacon associated with AdaptixC2...
The dropped PE is not AgentTesla itself but a DonutLoader shellcode packer. DonutLoader unpacks and executes the AgentTesla binary entirely in memory, leaving no additional artifacts on disk beyond the initial dropper.
extracts DonutLoader, a shellcode loader, from a PNG image present within the binary
The next-stage shellcode is a payload configured from DonutLoader ... used to wrap .NET assemblies, DLLs, and EXEs into position-independent shellcode.
DonutLoader is a shellcode-based loader leveraging the “Donut” fileless execution framework to deploy secondary payloads such as PureLogs stealer in-memory, avoiding disk-based artifacts
The loader uses self-modifying techniques with several decryption stubs to unroll itself ... [and] decrypts a 28,233-byte region ... [with] a single-byte XOR key that updates after every iteration.
Following execution notification, the malware prepares a disguised execution vehicle by creating a renamed copy of powershell.exe as HDVz.exe within the user's Downloads directory.
SysInternals ProcDump was renamed to windbg.exe and abused (-md) as a LOLBAS to load an unsigned malicious DLL.
DONUTLOADER shellcode ... attempted to inject into sessionmsg.exe. SPECTRALVIPER can load and inject executable files.
MITRE ATT&CK Mapping Tactic Technique ID Application Execution Reflective Code Loading T1620 Donut decrypts + loads PE in-memory Defense Evasion Obfuscated Files: Embedded Payloads T1027.009 Chaskey-16 CTR encrypted Donut payloads Defense Evasion Masquerading: Legitimate Name T1036.005 Process named nsvchost.exe Defense Evasion Subvert Trust Controls T1553 Inline C# avoids pre-compiled AV detection Privilege Escalation Token Manipulation T1134.001 SeDebugPrivilege via AdjustTokenPrivileges Discovery Process Discovery T1057 CreateToolhelp32Snapshot for svchost.exe Lateral Movement Process Injection: DLL Injection T1055.001 VirtualAllocEx + WriteProcessMemory into svchost.exe
Python runtime abuse for Early Bird APC injection into suspended legitimate processes
The loader then deletes the container within seconds ... Every observed loader detonation deleted Prefetch entries and wiped %TEMP%.
After the patching has taken place, the loader decrypts a 28,233-byte region... This similar decryption routine runs three times in total.
Using the renamed ProcDump application with the -md flag, the adversary loaded dbg.config, an unsigned DLL containing malicious code.
First, the code checks the machine’s UI language and exits immediately if it detects a CIS locale, such as Russian (ru), Belarusian (by), or Kazakh (kz).
The script terminates execution when specific username and filesystem conditions are met... Systems reporting less than 3 GB of RAM are considered suspicious, causing the script to exit without further execution.
After passing its environment-validation checks, the malware creates a working directory at C:\ProgramData\IntelDriver, applies the System (+s) and Hidden (+h) attributes...
Each blob carries an encrypted Remus PE, decrypts it at runtime, and maps it into memory with the PE header zeroed.
Defense Impairment
1 technique
Defense Impairment
To evade detection and reduce security visibility, the malware employs process injection, dynamic Application Programming Interface (API) resolution, Antimalware Scan Interface (AMSI) bypass, Event Tracing for Windows (ETW) tampering, and memory-resident execution techniques.
Discovery
3 techniques
Discovery
the malware invokes PowerShell to query the Win32_ComputerSystem class and retrieve the total amount of installed physical memory.
First, the code checks the machine’s UI language and exits immediately if it detects a CIS locale, such as Russian (ru), Belarusian (by), or Kazakh (kz).
The script terminates execution when specific username and filesystem conditions are met... Systems reporting less than 3 GB of RAM are considered suspicious, causing the script to exit without further execution.
Lateral Movement
1 technique
Lateral Movement
The first recorded event was creation of dbg.config by the System service, dropped over SMB from a previously compromised endpoint.
Command and Control
5 techniques
Command and Control
IcedID post-infection C2 traffic: 94.140.114[.]40 port 443 - primsenetwolk[.]com - HTTPS traffic 94.140.114[.]40 port 443 - onyxinnov[.]lol - HTTPS traffic 158.255.211[.]126 port 443 - trashast[.]wiki - HTTPS traffic
Process Monitor captured a curl.exe process issuing an HTTP POST request to the Telegram Bot API /sendMessage endpoint.
After process injection, the .NET implant attempts to connect to 167.88.167.9:8356 via outbound TCP, suggesting a dedicated command-and-control channel.
the malware established two distinct communication channels... issuing an HTTP POST request to the Telegram Bot API /sendMessage endpoint... indicating that successful execution is reported to an operator-controlled Telegram channel.
A loader already on the victim's computer fetches ... blobs directly from a bare IP on TCP/5000 ... [or] retrieves a loader PE first.
Observables
121 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
47 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.