Sandbox evasion is a collection of techniques that malware uses to detect whether it is executing inside a sandbox or virtual machine (VM) analysis environment, then alter its behavior to appear benign. MITRE ATT&CK catalogs these methods under T1497: Virtualization/Sandbox Evasion, spanning three sub-techniques that cover system fingerprinting, user activity validation, and time manipulation. Because email security tools routinely detonate attachments and URLs in sandboxed environments, sandbox evasion is a critical capability for email-delivered malware that needs to survive automated analysis.
Sandbox evasion techniques fall into three categories, each mapped to a MITRE ATT&CK sub-technique:
Email security gateways and inline security tools use sandboxing as a core detection layer. When an attachment or embedded URL arrives, it is detonated in an isolated environment to observe its behavior. Sandbox evasion directly undermines this process.
Attackers combine sandbox evasion with other obfuscation methods to compound the problem. Polymorphic malware changes its code signature on each execution, making static detection unreliable and placing more weight on behavioral sandbox analysis. When that behavioral layer is also evaded, defenders lose both detection angles simultaneously. Similarly, steganography payloads hidden inside image attachments may only extract and execute their concealed code after sandbox evasion checks confirm a real endpoint, not an analysis environment.
The Blitz malware family, identified in 2024, demonstrated a layered approach: it verified that the system had at least four CPU cores, checked screen resolution thresholds, scanned for known sandbox drivers in the registry, and only then proceeded to execute its payload. Each check individually might be inconclusive, but combined they provided high confidence that the environment was a real workstation.
Defenders counter sandbox evasion by configuring analysis environments to mimic production endpoints, including realistic hardware profiles, populated file systems, and simulated user activity. Content Disarm and Reconstruction (CDR) offers an alternative approach by stripping and rebuilding file content without relying on behavioral execution, neutralizing payloads regardless of evasion logic. Monitoring for indicators of compromise such as discovery commands, registry enumeration, and sleep API calls also helps flag evasion attempts during analysis.