[Intermediate → Advanced] — running the program and watching what it does, and doing it without infecting yourself.

The kid version first

Sometimes the fastest way to understand a suspicious program is to run it and watch — what files it creates, who it phones, what it changes. The catch is obvious: running malware can infect your machine, spread on your network, or destroy data.

Dynamic analysis is running the sample safely, in a disposable isolated environment, while instruments record everything it touches. It cuts through obfuscation that stops static analysis cold — because to do anything, the code must first un-hide itself in memory, where you can watch.

Rule zero: the isolated lab

Before running any malware, you need a safe place to run it. Getting this wrong is how analysts infect themselves and their networks. The non-negotiables:

  • A virtual machine you can throw away. Take a snapshot before running; revert after every sample. VirtualBox/VMware, a dedicated analysis VM (FLARE VM for Windows, REMnux for Linux tooling)
  • No path to anything real. Host-only or a fully isolated virtual network — never bridged to your LAN, never with access to shared folders or a mounted host drive
  • Fake the internet. Malware wants to reach its C2 server. INetSim or FakeNet-NG simulates DNS, HTTP and other services so the malware “connects” and reveals its behaviour without actually reaching the attacker (which would also tip them off) → the lab setup
  • Assume the malware knows it’s being watched — many samples detect VMs and behave differently, which is its own analysis problem → anti-VM

This is the home-lab discipline with the stakes turned up: a pentest lab attacks your targets; a malware lab runs live hostile code, so isolation is a safety requirement, not a convenience.

The two ways to watch

Behavioural monitoring — watch the effects.

Run the sample and observe what it does to the system, without caring about the code:

  • Process activity — what it spawns, injects into, or kills (Process Monitor, Process Hacker/System Informer)
  • File system — files created, modified, deleted (ransomware lights this up)
  • Registry (Windows) — persistence keys, config storage (...\Run, services)
  • Network — DNS lookups, connections, the C2 traffic (Wireshark, and FakeNet capturing it) → networking
  • API calls — every OS function it invokes (API Monitor, or a sandbox’s hooks)

Automated sandboxes do all of this for you. Submit a sample and get a report of every file, registry and network action:

  • Any.Run — interactive, browser-based, watch it live
  • Cuckoo / CAPE — self-hosted, open-source
  • Hybrid Analysis, Joe Sandbox — hosted services

A sandbox report is often the fastest first answer — for known-behaviour malware you may need nothing more. (Same caveat as VirtualTotal: public sandboxes make your sample public.)

Debugging — watch the code, instruction by instruction.

When you need to understand how, not just what, you step through execution with a debugger → debuggers:

  • x64dbg — the standard free Windows debugger for malware
  • WinDbg — Microsoft’s, powerful, kernel-capable
  • GDB (+ pwndbg/GEF) — Linux
  • Ghidra’s debugger — integrates with its static view

You set breakpoints (stop when it calls connect, or writes a file), inspect memory and registers, and control execution. This is the definitive tool for the hard parts — watching a value get decrypted, seeing which branch a check takes.

The killer technique: unpacking in memory

The reason dynamic analysis is essential: packed malware decrypts itself to run, so you let it, then grab the decrypted version.

   on disk:      [ packed / encrypted — static analysis sees garbage ]
        │ run it under a debugger
        ▼
   in memory:    [ the UNPACKED real code — because it must be, to execute ]
        │ dump memory at the right moment
        ▼
   dumped:       [ now analyse THIS statically — the real payload ]

The craft is finding the OEP (original entry point) — the moment unpacking finishes and the real code begins — then dumping the process memory (Process Hacker, Scylla, or a debugger plugin) and reconstructing a working file to analyse statically. This “run to unpack, then dump” loop is the core move against the packing that defeats static analysis → packing.

The workflow, combining both

Real analysis alternates static and dynamic:

  1. Static triage — hash, strings, imports → hypothesis → static
  2. Sandbox run — quick behavioural overview
  3. If packed: run under a debugger, unpack, dump, go back to static
  4. Targeted debugging — breakpoint the interesting behaviour (the C2 connect, the file encryption), watch it happen, extract details (the C2 address, the encryption key)
  5. Confirm and document — what it does, indicators to detect it

The limits

Dynamic analysis is powerful but partial:

  • You only see what runs. Code behind conditions that weren’t met (a specific date, a target-only check, a command not received) never executes, so you miss it. Static sees those paths; dynamic doesn’t
  • Evasion. Malware that detects the VM, the debugger, or the sandbox may sleep, exit, or run benign decoy behaviour → anti-analysis
  • Time and interaction. Some malware only acts after a delay, a reboot, or specific user activity, and a 2-minute sandbox run misses it

Key insight

Dynamic analysis runs the sample in a disposable, network-isolated VM and records everything it touches — which cuts through the packing that blinds static analysis, because code must un-hide itself in memory to execute, where you can dump it. The lab isolation is a safety requirement, not a nicety: you’re running live hostile code. And the two views stay complementary — dynamic shows what actually happened, static shows the paths that didn’t, so serious analysis loops between them rather than choosing one.

Source: [reference] — Aug 2026. Run live samples only in a properly isolated lab.

↑ Back to Malware Analysis and Reverse Engineering