# Malware Sandbox Analysis

> Use when you need to detonate a malware sample safely and extract structured behavioral evidence, covering process trees, file and registry activity, network traffic, and MITRE ATT&CK-mapped capabilities. Covers sandbox setup and snapshot discipline, choosing detonation time and interaction, reading sandbox reports, correlating dynamic findings with static triage, handling sandbox-aware samples, and turning a report into IOCs and detection content. Use when a sample arrives with unknown behavior, when static triage is inconclusive, or when an incident needs a behavior timeline for one host.

- Skill: `mizazhaider-ceh/malware-sandbox-analysis` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/malware-sandbox-analysis`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/malware-sandbox-analysis/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/malware-sandbox-analysis

---


A sandbox detonates a sample in an instrumented virtual machine and records
everything it does: processes it spawns, files it touches, registry keys it
sets, and network traffic it generates. The sandbox report is the fastest
path from "unknown binary" to "this is a downloader that beacons to this
domain every 60 seconds". This skill covers running a detonation with good
hygiene, reading the report critically, defeating common sandbox evasion,
and converting the findings into IOCs and detections. Scope: detonate only
samples you are authorized to handle, only inside an isolated sandbox
environment with no route to production networks, during authorized DFIR or
malware research. Never detonate on a workstation you care about.

## Quick Workflow

1. Hash the sample (sha256) and check existing reports first; do not
   re-detonate what is already analyzed.
2. Restore the sandbox VM to a clean snapshot and confirm network
   settings (isolated, simulated internet, or full block per policy).
3. Submit the sample with a realistic profile: user interaction enabled,
   5 to 10 minute timeout, correct OS and software matches.
4. Let it run to completion; do not kill it early unless it is clearly
   stuck (evasion analysis comes later, not during the first run).
5. Read the report top to bottom: process tree, signatures, network,
   dropped files, then raw behavioral logs.
6. Extract IOCs: domains, IPs, URLs, file paths, mutexes, registry keys.
7. Correlate with static triage: do the observed behaviors match the
   imports and strings?
8. Write the behavior summary with MITRE ATT&CK mapping and hand off IOCs
   to detection.

## 1. Sandbox setup and detonation hygiene

A sandbox is only trustworthy if the environment is controlled. Use
snapshots: one clean snapshot per OS profile, restored before every run.
Decide the network mode up front:

- Isolated with simulated services (INetSim/fake DNS): safest, lets the
  sample resolve and connect so you see its real protocol behavior.
- Full block: safest for destructive samples, but C2 beacons fail and you
  learn less.
- NAT with monitoring: only in a lab network with no production route, and
  only with explicit approval.

```bash
# CAPE CLI submission example
python3 utils/submit.py --package exe --timeout 600 \
  --machine win10x64 --tags office sample.exe

# Check status and pull the report when done
python3 utils/process.py --task-id 42
ls /opt/CAPEv2/storage/analyses/42/report/report.json
```

Record the task ID, machine profile, timeout, and network mode with every
report you keep. A report without its run parameters is not reproducible
evidence.

## 2. Reading a sandbox report

Read in this order; each layer constrains the next:

1. **Process tree.** Who spawned whom. A Word doc spawning powershell.exe
   spawning rundll32.exe is the whole story in three lines.
2. **Signatures / detections.** The sandbox's own YARA and behavior
   signatures. Treat as hints, not verdicts.
3. **Network.** DNS queries, HTTP requests, TCP connections. Sort by first
   seen; the first beacon defines the C2.
4. **Dropped / modified files.** Payloads written to disk, especially in
   Temp, AppData, and System32.
5. **Registry.** Run keys, services, WMI subscriptions: the persistence
   story.
6. **Raw API logs.** Only when the summary is ambiguous: which process
   called WriteProcessMemory, what buffer it wrote.

Example process tree shape from a dropper:

```text
sample.exe (PID 2140)
  +-- cmd.exe /c powershell -enc <base64> (PID 2210)
        +-- rundll32.exe C:\Users\x\AppData\Local\Temp\pay.dll,Run (PID 2330)
```

Example network excerpt:

```text
DNS  beacon.example-cdn[.]net -> 93.184.216.34
HTTP POST /api/v2/beacon  every 60s, User-Agent: NimbusAgent/2.1
```

Every IOC gets a context line: first seen, process that made it, and
frequency. An IP without context is noise.

## 3. When the sample does nothing: sandbox evasion

A clean report on a known-bad sample usually means evasion, not innocence.
Common checks and how to answer them:

- Sleep/delayed execution: increase timeout to 10+ minutes or patch the
  sleep (see the timing-checks sub-skill).
- VM artifact checks (registry keys, MAC addresses, process names): use a
  hardened profile or rename the obvious artifacts.
- User interaction checks: enable simulated clicks and document opens in
  the submission profile.
- Geofencing / time bombs: set the VM clock and locale to match the
  target, or run with a debugger to skip the check.

```bash
# Quick triage: did it even run its payload?
# Compare API call counts between a 2-min and a 10-min run
jq '.behavior.processes[].calls | length' report_2min.json
jq '.behavior.processes[].calls | length' report_10min.json
```

If the counts are identical and tiny, the sample exited early: it is
evading. Confirm with static triage (look for Sleep, GetTickCount,
VM-check strings) and then re-run with countermeasures from the
anti-vm-detection sub-skill.

## 4. Correlating dynamic with static

Dynamic confirms or refutes static. Build a two-column check:

```text
Static says                     Dynamic shows
CreateRemoteThread import       rundll32.exe injected, thread created -> CONFIRMED
RegSetValueEx import            HKCU\...\Run key written            -> CONFIRMED
WSAConnect import               no network traffic                 -> EVASION or dead C2
```

Unconfirmed static findings become follow-up tasks: a dead C2 means you
pivot to config extraction for the real address; missing network with
socket imports means evasion to defeat. Confirmed findings become
detections: a Sigma rule for the Run key value, a YARA rule for the
dropped payload.

## 5. From report to IOCs and detection

Extract IOCs with context and confidence:

```bash
# Pull network IOCs from a CAPE JSON report with jq
jq -r '.network.dns[] | "\(.request) -> \(.answers[]?)"' report.json | sort -u
jq -r '.network.http[] | "\(.method) \(.host)\(.uri)"' report.json | sort -u
jq -r '.behavior.summary.mutexes[]?' report.json | sort -u
```

Write each IOC as: value, type, first seen, process, confidence
(confirmed/high/medium), expiry suggestion. Feed domains and URLs to the
proxy blocklist, hashes to the EDR, mutex and registry values to Sigma
rules. Keep the full report archived with the sample hash; IOCs age out,
the report does not.

## 6. Memory capture for the deep cases

When behavior is interesting but the payload never touches disk (fileless
execution), capture VM memory at the right moment and analyze offline:

```bash
# After detonation, snapshot memory (hypervisor-dependent)
virsh dump win10-vm /cases/2026-10-23/mem.dmp --memory-only

# Then hunt injected code with Volatility
vol -f mem.dmp windows.malfind.Malfind
vol -f mem.dmp windows.pslist.PsList
```

malfind output showing executable private memory in a legitimate process
is your injected payload; dump it with `--dump` and send it back through
static triage.

## Edge cases

- Multi-stage droppers: the first detonation only shows stage one. Follow
  each dropped payload with its own detonation; chain the reports.
- Samples that need a specific trigger (a document macro, a DLL export, a
  command-line argument): submit with the right package and arguments, or
  the run is wasted.
- Time bombs and logic bombs: a sample that does nothing today may detonate
  on a date. Check static strings for dates before concluding it is benign.
- Sandbox-only artifacts: some malware behaves differently under any VM.
  Compare against a bare-metal detonation when the stakes justify it.
- Encrypted C2: you will see the connection but not the content. Note the
  JA3/JA4 fingerprint and beacon interval; that is still a detection.
- Samples that destroy the VM (wipers, ransomware): run with snapshots and
  short timeouts, and never with network modes that let them spread.
- Legitimate software bundled with the sample: detonate the exact file
  from the incident, not a re-downloaded "same version", or you analyze
  the wrong thing.

## Escalation

- If the sample detects the sandbox after hardening (still exits early),
  escalate to manual dynamic analysis in a debugger (x64dbg) or to bare
  metal, and record which check defeated you.
- If the report shows process injection or hollowing, escalate to memory
  forensics: capture RAM and extract the injected payload for separate
  analysis.
- If network traffic is encrypted and the C2 must be identified, escalate
  to config extraction (malware-config-extraction) for the plaintext
  address from the binary.
- If the sample spreads (worm behavior, lateral movement attempts),
  isolate the sandbox host immediately, document what it tried, and notify
  the incident lead before further detonations.

## Detection and defender view

Every sandbox run should produce defender artifacts, not just analyst
notes. Minimum set per sample: file hashes (sha256), network IOCs with
first-seen context, persistence artifacts (registry keys, scheduled tasks,
services), and one behavior signature in your detection language (Sigma
for the process tree pattern, YARA for dropped payloads). Map behaviors
to MITRE ATT&CK: a Run key is T1547.001, process injection is T1055,
beaconing is T1071. Feed the ATT&CK mapping back to the SOC so the alert
they get reads as a technique, not just a hash. Review sandbox IOCs
weekly: C2 domains die fast, and stale IOCs cause alert fatigue that
hides the next incident.

## Key references

- CAPE Sandbox documentation:
  https://capev2.readthedocs.io/
- Cuckoo Sandbox documentation:
  https://cuckoo.sh/docs/
- MITRE ATT&CK (behavior mapping):
  https://attack.mitre.org/
- Wireshark documentation:
  https://www.wireshark.org/docs/
- Volatility 3 documentation:
  https://volatility3.readthedocs.io/
- SANS FOR610 / malware analysis cheat sheets (behavioral indicators):
  https://www.sans.org/posters/
- INetSim (simulated internet services for labs):
  https://www.inetsim.org/

## See also

- `dynamic-sandbox`: Use it instead when the work is setting up and instrumenting the sandbox execution itself, with snapshots and simulated network services.

