$npx -y skills add meltedinhex/analyst-ai-pack --skill detecting-sandbox-evasion-behaviorDetects sandbox and analysis evasion techniques in a sample by scanning static
| 1 | # Detecting Sandbox Evasion Behavior |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - A sample ran inertly in a sandbox and you suspect evasion. |
| 6 | - You want to enumerate anti-VM, anti-debug, timing, and environment-fingerprinting checks from |
| 7 | static strings/imports and/or an API trace. |
| 8 | |
| 9 | **Do not use** this to conclude a sample is benign — evasion is itself a malicious signal, and |
| 10 | absence of detected checks does not prove there are none. |
| 11 | |
| 12 | ## Prerequisites |
| 13 | |
| 14 | - The sample (read inertly) and optionally a JSON API trace. |
| 15 | |
| 16 | ## Safety & Handling |
| 17 | |
| 18 | - Read bytes statically; never execute the sample to "see if it evades." |
| 19 | |
| 20 | ## Workflow |
| 21 | |
| 22 | ### Step 1: Scan for evasion indicators |
| 23 | |
| 24 | ```bash |
| 25 | python scripts/analyst.py scan sample.bin |
| 26 | ``` |
| 27 | |
| 28 | Searches for VM/sandbox artifact strings (`VMware`, `VBOX`, `vmtoolsd`, `sbiedll`, common |
| 29 | sandbox usernames/hostnames), anti-debug APIs (`IsDebuggerPresent`, `CheckRemoteDebuggerPresent`, |
| 30 | `NtQueryInformationProcess`), timing stalls (`Sleep`, `GetTickCount`, `rdtsc`), and CPUID checks. |
| 31 | |
| 32 | ### Step 2: Categorize techniques |
| 33 | |
| 34 | Group hits into anti-VM, anti-debug, anti-sandbox, and timing/stalling categories. |
| 35 | |
| 36 | ### Step 3: Recommend bypass and report |
| 37 | |
| 38 | Suggest analysis adjustments (patch sleeps, hardened VM, hooking) and map findings to ATT&CK. |
| 39 | |
| 40 | ## Validation |
| 41 | |
| 42 | - Detected indicators are grouped by evasion category. |
| 43 | - Findings distinguish static-string evidence from API-trace evidence when both are provided. |
| 44 | - Each category maps to an ATT&CK technique/subtechnique. |
| 45 | |
| 46 | ## Pitfalls |
| 47 | |
| 48 | - False positives from benign software that also queries the environment — corroborate. |
| 49 | - Strings can be obfuscated; absence of plaintext artifacts is not absence of evasion. |
| 50 | - Confusing a hung sample with deliberate stalling without timing evidence. |
| 51 | |
| 52 | ## References |
| 53 | |
| 54 | - See [`references/api-reference.md`](references/api-reference.md) for the scanner. |
| 55 | - ATT&CK T1497 and T1622 (linked in frontmatter). |