| name | analyzing-malware-sandbox-evasion-techniques |
| description | Detect sandbox evasion techniques in malware samples by analyzing timing checks, VM artifact queries, user interaction detection, and sleep inflation patterns from Cuckoo/AnyRun behavioral reports |
| domain | cybersecurity |
| subdomain | malware-analysis |
| tags | ["sandbox-evasion","malware-analysis","cuckoo","anyrun","mitre-attack","virtualization-detection","behavioral-analysis"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| d3fend_techniques | ["Platform Hardening","Restore Object","Process Analysis","System Call Filtering","Restore Software"] |
| nist_csf | ["DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01"] |
Analyzing Malware Sandbox Evasion Techniques
Overview
Sandbox evasion (MITRE ATT&CK T1497) allows malware to detect analysis environments and alter behavior to avoid detection. This skill analyzes behavioral reports from Cuckoo Sandbox and AnyRun for evasion indicators including timing-based checks (GetTickCount, QueryPerformanceCounter, sleep inflation), VM artifact detection (registry keys, MAC address prefixes, process names like vmtoolsd.exe), user interaction checks (mouse movement, keyboard input), and environment fingerprinting (disk size, CPU count, RAM). Detection rules flag samples exhibiting these behaviors for deeper manual analysis.
When to Use
- When investigating security incidents that require analyzing malware sandbox evasion techniques
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Detection Gaps & Validation
- The evasion paradox: a clean report can mean total evasion. If the sample fingerprinted the sandbox and exited, the behavioral JSON has nothing to score - absence of malicious API calls is itself a signal, not proof of benignity. Flag "executed for 2s, no activity" as suspicious.
- Hooked-API analysis misses unhooked checks. Direct syscalls (no ntdll hooks),
RDTSC/CPUID timing instead of GetTickCount/QueryPerformanceCounter, and environment-keyed payloads (no VM-artifact API at all - they just fail to decrypt) won't appear in Cuckoo's API trace.
- Single-sandbox blind spot. One environment can't distinguish "benign" from "evaded"; detonate the same sample across two differently-configured sandboxes (and bare metal) and compare - behavioral divergence is the strongest evasion indicator.
- Confirm a hit: locate the actual check via static RE (Ghidra: find the VM-artifact string/registry query or timing instruction), patch/NOP it or run on a hardened/bare-metal host, and confirm the payload now detonates.
- False positives: commercial packers, DRM, anti-cheat, and games legitimately use anti-debug, timing checks, and
GetCursorPos. Require multiple correlated evasion techniques plus a malicious payload before classifying as evasive malware.
Prerequisites
- Cuckoo Sandbox 2.0+ or AnyRun account for behavioral analysis reports
- Python 3.8+ with json library for report parsing
- Behavioral report exports in JSON format
Steps