Donut
Overview
Executive Summary
Donut is a highly sophisticated, open-source offensive security framework designed to generate position-independent shellcode from .NET, VBScript, JScript, and standard PE (Portable Executable) files. While originally developed for legitimate penetration testing and Red Team operations, Donut is heavily abused by Advanced Persistent Threat (APT) groups and ransomware operators to facilitate highly evasive, in-memory execution of malicious payloads.Technical Architecture and Exploitation
Donut is not malware itself; rather, it is a tool used by attackers to obfuscate and deliver their actual malware (e.g., Cobalt Strike beacons, Mimikatz, or custom RATs). The core functionality of Donut involves:- Shellcode Generation: The attacker uses the Donut framework to convert their primary executable payload (e.g., a .NET assembly or a compiled C++ binary) into raw, position-independent shellcode.
- AMSI Bypass: Donut is specifically engineered to bypass the Windows Anti-Malware Scan Interface (AMSI) and Windows Defender Application Control (WDAC). The generated shellcode often includes built-in routines to unhook or patch these defensive APIs in memory before executing the primary payload.
- In-Memory Execution: The resulting Donut shellcode is typically injected into a legitimate, running process (process hollowing or thread hijacking) via a simple dropper. Because the shellcode executes entirely in memory (RAM) without dropping the original executable to the hard drive, it effectively bypasses traditional, file-based static antivirus scanning.
Threat Impact
The detection of Donut-generated shellcode indicates a sophisticated, targeted attack utilizing advanced evasion techniques. It allows threat actors to silently load powerful post-exploitation tools, facilitating rapid privilege escalation, credential dumping, and lateral movement while blinding local security sensors.Defense and Resilience Strategies
- Behavioral EDR Monitoring: Static scanning is highly ineffective against Donut. Defenses must rely on advanced Endpoint Detection and Response (EDR) solutions configured to monitor for cross-process memory injection, unusual thread creation within system processes, and anomalous API usage (e.g., `CreateRemoteThread`, `VirtualAllocEx`).
- AMSI Monitoring: Ensure EDR solutions are actively monitoring for attempts to patch or unhook the AMSI functions (e.g., `AmsiScanBuffer`).
- Memory Forensics: When a suspicious process is identified, responders must capture and analyze a live memory dump to extract the injected Donut shellcode and reverse-engineer the underlying payload.
Known aliases
Threat reports may refer to this family under multiple names:
MITRE ATT&CK Techniques
This family has been observed using the following ATT&CK techniques: T1055 T1562.001 T1027.005 T1620
Generated Detections (Boilerplate)
These YARA and Sigma rules are auto-generated based on the family name and aliases. They must be heavily tuned before deployment in a production environment.
YARA Rule
rule MALWARE_WIN_DONUT {
meta:
description = "Detects Donut (ransomware)"
author = "SystemHelpdesk Boilerplate Generator"
date = "2026-07-06"
strings:
$s1 = "donut" ascii wide nocase
$s2 = "hacktool.donut" ascii wide nocase
$s3 = "tool.donutshellcode" ascii wide nocase
$s4 = "riskware.donut" ascii wide nocase
condition:
uint16(0) == 0x5a4d and any of them
}Sigma Rule
title: Suspicious Donut Activity
id: 81bdd90fd4bc5a1c9b7b603014ff1388
status: experimental
description: Detects generic indicators of the donut malware family.
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
CommandLine|contains:
- "*donut*"
- "*hacktool.donut*"
- "*tool.donutshellcode*"
- "*riskware.donut*"
condition: selection
level: mediumReferences & External Analysis
- Search "donut" on VirusTotal (External Analysis)
Frequently Asked Questions
How do I remove the Donut Ransomware from Windows?
Manual removal of Donut is highly discouraged as it may leave persistence mechanisms intact. We recommend disconnecting the device from the internet and utilizing a professional incident response service or enterprise-grade EDR software to conduct a full forensic sweep.
Is Donut a virus or a Ransomware?
Donut is classified as a Ransomware. Unlike traditional viruses that infect files, modern malware like Donut typically operates as a standalone payload designed to compromise systems, steal data, or deploy secondary stage implants.
What are the main symptoms of a Donut infection?
Symptoms of Donut can include unexpected system slowness, unauthorized outbound network traffic to unknown IP addresses, disabled security software, and suspicious background processes running from AppData or Temp directories.
Related Families (Category: ransomware)
Explore other malware families in the same category:
Protect Your Network Against Ransomwares
Want to prevent Donut and similar threats from compromising your organization? Read our comprehensive defensive guide: Ransomware Protection Guide.
Machine-readable
Get this profile as JSON: https://jordan123234-malware-families-explorer.static.hf.space/api/donut.json
Ecosystem & Interactive Environments
This profile is part of the Malware Families Catalog, a public dataset of 2,899 malware families. The catalog is also published across our ecosystem: Hugging Face, Kaggle, Zenodo, Replit, StackBlitz, CodeSandbox, and CodePen.