1. Building a Safe Malware Analysis Lab

Virtual machines, fake internets, snapshots and sample handling: the glovebox you build before you open anything hostile, for both Windows and Linux samples

Picture a biology lab that works with dangerous bacteria. Nobody opens the sample jar on the kitchen table. The work happens inside a sealed glovebox: you reach in through thick rubber gloves, the air is pulled inward so nothing drifts out, things go in and out only through an airlock, and when you're done the whole box is sterilised before the next experiment. The rules feel slow and fussy. They exist because the one time you skip them is the time it matters.

A malware analysis lab is the same idea, built out of software. The sample runs inside a virtual machine (the glovebox). Its network traffic goes to a fake internet that answers its questions without letting anything out (the airlock). Before each experiment you restore a clean snapshot (the steriliser). And there's a set of handling rituals — password-protected zips, renamed files, hashes, defanged addresses — that keep the sample from going off by accident on the way in.

This is the first article in the Malware Analysis series, and it doesn't analyse anything. It builds the room where every later article happens. We'll set up two environments, one for Windows samples (.exe, .dll, Office documents) and one for Linux samples (ELF binaries, shell scripts), connected to a gateway that fakes the internet for both. Along the way we'll be specific about what we're protecting against, because a lab built against an imaginary threat tends to be both inconvenient and leaky.

A note on scope

This series is about taking hostile code apart to defend against it: understanding what a sample does so you can detect it, block it, and clean up after it. It never shows you how to write or deploy malware. If you're here to learn the defensive craft, welcome.

What Are We Actually Protecting Against?

The image most people have of lab danger is dramatic: the malware notices it's in a VM, breaks through the hypervisor, and takes over the host. That's called a VM escape, and it does exist. In 2015 the VENOM bug (CVE-2015-3456) showed that QEMU's virtual floppy disk controller, present in every x86 guest even with no floppy attached, had a buffer overflow that could let a guest run code in the host's QEMU process. VM escapes also turn up as prize-winning entries at hacking contests like Pwn2Own. But they're rare, valuable, and quickly patched. The everyday sample you'll analyse is not carrying one.

The realistic risks are much more mundane, and almost all of them are doors we open ourselves:

YOUR HOST MACHINE Analysis VM sample.exe running, hostile Host files SSH keys, browser data, documents, photos Hypervisor (VirtualBox, VMware, KVM, Hyper-V) Home / office LAN NAS, laptops, printer router Internet attacker's servers 1 2 3 4 1 Network: the sample reaches your LAN or the real internet. The most common leak. 2 Shared folders, clipboard, drag-and-drop: doors into the host you opened on purpose. 3 You: copying a sample out, or double-clicking it on the host by mistake. 4 VM escape: needs a hypervisor bug. Rare, but real (VENOM, 2015).

Ranked by how likely they are to bite you:

  1. The network. A VM on a bridged or NAT network can reach everything your host can: the router's admin page, the family NAS, other laptops, and the internet. A worm will happily scan the LAN for open file shares. Ransomware will encrypt any network drive it can see. A bot will phone home to its operator, tell them a new victim has appeared at your IP address, and download whatever comes next.
  2. Integration features. Shared folders, a shared clipboard, and drag-and-drop are convenient precisely because they punch holes between guest and host. A sample that encrypts "every document it can reach" will reach a mapped shared folder.
  3. You. Unzipping a sample on the host to "just look at it", double-clicking something whose icon looks like a PDF, pasting a live URL into your everyday browser. Most lab accidents are human.
  4. VM escape. Real, but rare. Keeping the hypervisor patched is the main defence.

The rest of this article closes those doors in that order of importance. Isolation is mostly about #1 and #2, the handling rituals are about #3, and keeping your hypervisor updated takes care of most of #4.

Choosing a Hypervisor

A hypervisor is the software that runs the virtual machines. There are two broad kinds: Type 1, which sits directly on the hardware, and Type 2, which is an application you install on your normal operating system. For a home lab the distinction matters less than you'd think. What you care about is snapshots, flexible networking, and how loudly the VM announces that it is a VM.

VirtualBox

Oracle's VirtualBox is free, open source, and runs on Windows, Linux and macOS (Apple Silicon Macs are supported as hosts since version 7.1 in September 2024). It's what most tutorials use, so help is easy to find. Its network modes are clear (we'll use its Internal Network mode later), and snapshots work well. The separate Extension Pack is under a different licence that isn't free for commercial use, so check before using it at work. Because it's so popular with analysts, VirtualBox's fingerprints are among the best-known to malware authors.

VMware Workstation Pro (and Fusion on macOS)

The long-standing professional choice. Snapshots and cloning are polished, and its LAN Segments give you private networks without the host attached. Since Broadcom's announcement on 11 November 2024, Workstation Pro and Fusion Pro are free for personal, educational and commercial use (you need a Broadcom account to download them). VMware is also the hypervisor malware checks for most often.

KVM/QEMU (Linux hosts)

KVM is built into the Linux kernel, and QEMU provides the virtual hardware. Managed through virt-manager or virsh (libvirt), it's free, fast, and gives you fine-grained control over what the guest sees: CPU flags, firmware strings, disk and network device models. That control is why automated sandboxes such as CAPE are commonly built on KVM. The learning curve is steeper than the desktop products.

Hyper-V (Windows hosts)

Built into Windows Pro, Enterprise and Education. It has checkpoints (its word for snapshots) and a Private virtual switch that connects VMs to each other but not to the host. Two cautions. First, Hyper-V's Enhanced Session mode connects to the VM over RDP and redirects the clipboard by default, so use the basic console or turn redirection off. Second, enabling Hyper-V (or Windows features built on it, like Memory Integrity) changes how VirtualBox and VMware run on the same host: they fall back to running on top of the Windows hypervisor, which can be noticeably slower.

Hypervisor Host OS Private-network mode
VirtualBox Windows, Linux, macOS Internal Network
VMware Workstation / Fusion Windows, Linux / macOS LAN Segment
KVM/QEMU (libvirt) Linux Isolated network
Hyper-V Windows Private switch

Any of these will do. Pick the one you'll actually keep patched.

Samples Know When They're in a VM

Here's the catch with every option above. Malware authors know analysts use VMs, so many samples check for one and behave innocently if they find it: they sleep, exit, or do something harmless. This is called evasion, and the checks are usually simple:

Common things a sample looks at

  • The CPU itself. The CPUID instruction has a "hypervisor present" bit, and a hypervisor-specific leaf that returns a vendor string such as VMwareVMware, VBoxVBoxVBox, KVMKVMKVM or Microsoft Hv.
  • Network card MAC prefixes. The first three bytes of a MAC address identify the manufacturer. VirtualBox's default is 08:00:27; VMware uses 00:0C:29 and 00:50:56.
  • Guest tools. Processes, services, drivers and registry keys left by VirtualBox Guest Additions or VMware Tools (VBoxService.exe, vmtoolsd.exe).
  • Hardware strings. Disk model names, BIOS vendor, and SMBIOS fields that say "VirtualBox" or "VMware".
  • "Does this look like a real person's PC?" One CPU core, 2 GB of RAM, a tiny disk, no browser history, a screen resolution of 800×600, and a mouse that never moves.

You can fight this in two ways, and as a beginner you should mostly do the first:

Accept it, and notice it

Use a stock VM. When a sample seems to do nothing, consider that it may have spotted the VM, and look for the check during static analysis or in a debugger. Finding the check is itself a useful result.

Harden the VM

Change MAC addresses, give the VM realistic CPU, RAM and disk sizes, use some files and a browser so it looks lived-in, and (on KVM especially) hide hypervisor signatures. Tools like pafish and al-khaser test how detectable your VM is.

For the very stubborn cases, some professional labs keep a physical "sacrificial" machine that gets re-imaged from a clean disk image after each run. That's well beyond a starter lab, but it's good to know the option exists.

Snapshots: The Steriliser

A snapshot freezes a VM's disk (and optionally its memory) at a moment in time. Later you can revert to it and every change since then — files written, registry keys added, services installed, the whole infection — is gone in seconds. This is the single most important habit in the lab, and the discipline is simple: every analysis starts from the clean snapshot, and ends by reverting to it.

Base OS installed Tools updates, AV off CLEAN lab network only detonate sample A detonate sample B revert revert Never take a new snapshot on top of an infected state, and never "clean up" a used VM by hand.
  1. Build and configure the VM

    Install the OS, the analysis tools, and every setting from this article, while the VM still has internet access for downloads.

  2. Cut it off, then snapshot

    Switch the VM to the isolated lab network, check it can't reach the internet or your LAN, shut it down (or pause it), and take the snapshot. Give it an unmistakable name like CLEAN 2026-11-14 tools+isolated.

  3. Bring the sample in, detonate, observe

    Copy the encrypted zip in (more on how below), extract, run your monitoring tools, run the sample, collect results.

  4. Get the results out, not the sample

    Export logs, packet captures and notes, ideally as plain text or from the gateway VM rather than the infected guest.

  5. Revert

    Restore the clean snapshot, even if "nothing happened". Especially if nothing happened: you can't tell what you didn't see.

The same loop as pseudocode, because it's worth seeing how little room it leaves for improvisation:

for each sample:
    vm.revert("CLEAN")                 # always start from known-good
    assert vm.network == "labnet"      # isolated, checked, every time
    vm.copy_in(sample.zip)             # encrypted zip, never the bare file
    start_monitoring()                 # procmon / strace / tcpdump on gateway
    vm.run(sample)
    wait(observation_window)
    results = collect_logs()           # text, pcaps, screenshots
    vm.revert("CLEAN")                 # throw the infected state away
    store(results, tagged_with=sample.sha256)

Two subtleties. A snapshot is not a backup: it lives on the host's disk next to the VM and depends on the base disk being intact, so keep a separate copy of your clean VM exported somewhere safe. And when you do need to update the tools, revert to clean first, update with the network temporarily enabled, re-isolate, and take a new clean snapshot. Never update a VM that has had a sample on it.

Network Isolation: Building a Fake Internet

Most hypervisors offer the same handful of network modes under different names. The question that matters for each one is: if a sample runs in this VM, what can it reach?

Network modes, from leakiest to tightest

  • Bridged. The VM sits directly on your physical LAN with its own address, like another laptop plugged into your router. It can reach every device in the house and the internet. Never use this for analysis.
  • NAT. The VM shares the host's connection through the hypervisor's NAT. It can't be reached from the LAN, but it can reach out to the LAN and to the internet, from your IP address, and it can still reach services on the host itself (VirtualBox exposes the host at 10.0.2.2). Fine for installing tools, wrong for detonation.
  • Host-only. A private network between the VMs and the host. No internet, no LAN, but the host is on it, so any service listening on the host (file shares, a dev web server, SSH) is reachable by the sample.
  • Internal / Private / LAN segment. VMs talk only to each other. The host isn't on the network at all. This is what we want.

FLARE-VM's instructions say to switch to host-only once installation finishes, which is a reasonable default as long as you firewall the host's interface on that network. Using an internal network with a gateway VM removes the host from the picture entirely, which is the layout used in the rest of this article.

Why not just unplug the network?

You could give the VM no network card at all. That's perfectly safe, and for some work (pure static analysis) it's all you need. But a lot of malware does nothing interesting until it talks to the network. It resolves a domain, fetches a configuration file, or downloads a second stage. If the DNS lookup fails, many samples simply exit, and you've learned nothing.

The answer is a fake internet: a second VM on the same isolated network that pretends to be every server the sample might want. It answers DNS queries with its own address, serves a plausible web page for any URL, accepts any email, and logs everything. The sample thinks it's online; in reality every packet ends up in your logs.

HOST (not on labnet) Windows victim FLARE-VM 10.10.10.20 Linux victim Ubuntu/Debian + tracers 10.10.10.30 labnet · internal network · 10.10.10.0/24 REMnux gateway 10.10.10.1 (gateway + DNS) INetSim / FakeNet-NG: fake DNS, HTTP(S), SMTP, FTP, IRC... + tcpdump VPN egress optional, off by default Internet Home LAN no path in or out The victims use REMnux as both gateway and DNS server. Nothing else is reachable.

The gateway VM: REMnux with INetSim or FakeNet-NG

REMnux is a free Linux distribution for malware analysis maintained by Lenny Zeltser. The current appliance is built on Ubuntu 24.04 and ships as ready-made VM images for VirtualBox, VMware and Proxmox, with arm64 builds for Apple Silicon. It's both a toolbox (we'll use it for static analysis later in the series) and an excellent gateway, because it comes with two network fakers:

  • INetSim (Internet Services Simulation Suite, by Thomas Hungenberg and Matthias Eckert) simulates DNS, HTTP and HTTPS, SMTP and POP3 (with TLS variants), FTP, TFTP, IRC, NTP and a handful of older services. Its DNS server answers every query with one address you choose, and its HTTP server returns a default file for any request, matched by extension: ask for .exe and you get a harmless dummy executable, ask for .png and you get an image.
  • FakeNet-NG (from Mandiant's FLARE team) does a similar job with a different design. On Linux it can run in MultiHost mode, faking services for other machines, so it works as a gateway too. On Windows it runs in SingleHost mode, intercepting the traffic of the machine it's installed on. That means you can also run it inside FLARE-VM, which ships it, with no gateway VM at all. It's handy for a quick look.

Here's what happens when a sample on the Windows victim tries to reach its server, with the victims configured to use 10.10.10.1 as both their default gateway and their DNS server:

  1. The sample looks up its server's name

    It asks for update-cdn[.]example (defanged; more on that below). The victim's resolver sends the query to 10.10.10.1, port 53.

  2. INetSim answers with itself

    The fake DNS server replies 10.10.10.1, as it does for every name. The query is logged with a timestamp. You now know the domain the sample wanted, which is an IOC.

  3. The sample connects and asks for something

    It opens TCP port 80 on 10.10.10.1 and sends GET /cfg/stage2.bin. INetSim's HTTP server logs the full request, including headers like the User-Agent, which are often distinctive.

  4. The sample gets a harmless dummy back

    INetSim returns its default file for the extension. The real second stage never arrives, and nothing has left the lab, but you've captured the URL it wanted.

Two practical details. Samples sometimes use a hard-coded IP address instead of a domain name, and those packets go to the default gateway. To answer them, the gateway has to accept traffic addressed to any IP and redirect it to the fake services: INetSim can do this on Linux using the kernel's packet queueing, and REMnux also provides an accept-all-ips helper script that accepts connections to any IPv4 or IPv6 address and redirects each one to the matching port on the gateway itself. And run tcpdump or Wireshark on the gateway's lab interface for every detonation. The packet capture is evidence that doesn't depend on the infected machine telling the truth.

When you need the real internet

Sometimes the fake internet isn't enough. Perhaps you need the actual second-stage payload, or to see what commands a live server sends. Controlled internet access is a legitimate technique, but it changes your risk profile completely, and it should be a deliberate, time-boxed decision rather than a default.

Never: from your home or office IP

The attacker's server sees your real address and learns that someone is analysing their sample. They may block you, serve you decoys, or take an interest in you. If the sample sends spam, scans the internet, or joins a DDoS, the abuse reports name your IP, and your ISP will be the one calling.

If needed: through a VPN on the gateway

Route only the gateway's outbound traffic through a VPN, with a kill switch so a dropped tunnel can't fall back to your real connection. Block ports you don't need (outbound SMTP especially), keep the packet capture running, and switch it off when you have your answer.

Check your VPN provider's terms of service; not all of them welcome this traffic. And keep in mind that a live sample with real internet can do real harm to other people. Use live access to answer a specific question, then turn it off.

Lab Leak Checker

Configure a victim VM the way you might set it up in your hypervisor, and watch which paths a hostile sample could use to get out. Red paths are open, amber ones are open with caveats, green means the sample is talking to something you control, and grey is closed. It starts as a freshly created VM with default NAT networking. Try the presets, then flip one setting at a time.

Network mode

VM integration

Lab network

Path 10, a VM escape, stays grey in every configuration: it needs a hypervisor bug, and those are rare and quickly patched. Every other line on the diagram is a setting you chose.

The Windows Analysis VM

Most malware in the wild targets Windows, so this is the VM you'll use most. The usual starting point is FLARE-VM, Mandiant's collection of install scripts that turns a fresh Windows VM into an analysis workstation: disassemblers and decompilers (Ghidra, IDA Free), debuggers (x64dbg), PE inspection tools (PEStudio), Sysinternals (Process Monitor, Process Explorer, Autoruns), Wireshark, Regshot, FakeNet-NG, and a long list more.

FLARE-VM is installed on top of a Windows VM you provide. Microsoft offers evaluation ISOs of Windows, which suit this kind of short-lived machine. The project's stated requirements are Windows 10 or later, PowerShell 5 or later, at least 60 GB of disk and 2 GB of RAM (give it more if you can; 4 GB or more makes the tools far more pleasant, and also makes the VM look less like a sandbox), and a username without spaces or special characters.

  1. Install Windows, with the network on

    Use NAT networking for now; the installer needs to download hundreds of packages.

  2. Disable Windows Update inside the VM

    Updates would change your "clean" state, reboot in the middle of an analysis, and try to reach Microsoft from an isolated network. The VM is disposable; it gets its fixes when you rebuild it.

  3. Turn off Tamper Protection, then Microsoft Defender

    Defender will quarantine samples and many of the tools before you can study them. Turn off Tamper Protection in Windows Security first (otherwise Defender re-enables itself), then disable Defender, preferably via Group Policy as the FLARE-VM documentation describes. Defender's automatic sample submission would also upload your samples to Microsoft, which matters for confidential ones.

  4. Take a pre-install snapshot

    The FLARE-VM README recommends this, so you can retry if the install fails.

  5. Run the FLARE-VM installer

    From an administrator PowerShell, following the README: download install.ps1, unblock it, allow script execution, run it. It takes a while and reboots several times.

  6. Close the integration doors

    Disable shared folders, shared clipboard and drag-and-drop in the VM's settings (see below).

  7. Isolate and snapshot

    Move the VM to labnet, set its IP to 10.10.10.20 with gateway and DNS 10.10.10.1, confirm it can't reach the internet, and take the CLEAN snapshot.

Inside the VM only

Everything in that list that lowers security (Defender off, updates off) applies only to the disposable guest. Your host keeps its antivirus, its updates, and its firewall. In fact, the host's antivirus is a useful safety net: if a sample ever lands on the host unencrypted, you want it quarantined.

Shared folders, clipboard, and guest tools

Every hypervisor's guest tools (VirtualBox Guest Additions, VMware Tools, Hyper-V's integration services) add conveniences: a resizable screen, smooth mouse, shared clipboard, drag-and-drop, shared folders. For analysis, treat each one separately:

  • Shared folders: off. This is the biggest one. A mapped folder is a writable path from the guest into the host's filesystem. Move samples in by other means (an ISO image you attach read-only, or a transfer from the gateway VM over the lab network) and results out the same way.
  • Shared clipboard and drag-and-drop: off. Some malware monitors or replaces the clipboard (cryptocurrency-address swappers are a whole genre). A bidirectional clipboard also invites you to paste a live URL into your host browser.
  • The guest tools themselves: a trade-off. They make the VM much nicer to use, but they're also some of the most obvious VM artefacts a sample can check for, and their host-guest channels are attack surface. A reasonable starting point is to install them with the sharing features disabled. If a sample seems to be detecting the VM, try a clone without them.

The Linux Side: REMnux and a Linux Victim

Linux malware is a real and growing category: botnets built from routers and IoT devices, cryptominers on cloud servers, ransomware aimed at virtualisation hosts. These samples are ELF binaries and shell scripts, and they need a Linux machine to run on.

REMnux is the toolbox, not the victim

It's tempting to run Linux samples on REMnux, since it's right there. Don't. REMnux is your gateway and your static-analysis workstation; it holds your notes, your packet captures and your fake services. You want it trustworthy. Instead, build a separate, deliberately plain Linux victim VM: a minimal Ubuntu or Debian install that looks like an ordinary server, on labnet at 10.10.10.30, snapshotted clean like the Windows one.

On it, install the tools that watch what a program does:

  • strace records every system call a process makes: every file opened, every socket created, every process spawned.
  • ltrace records calls into shared libraries like libc (strcmp, getenv, fopen). It only sees dynamically linked calls, so it's blind on statically linked binaries, which much IoT malware is.
  • sysdig captures system activity through a kernel module or eBPF probe and saves it to a trace file you can filter afterwards.
  • auditd, the Linux audit daemon, logs kernel events according to rules you set, such as every program execution or every write to a sensitive directory.

strace and ltrace work by attaching to the process with ptrace, and a process can only have one tracer at a time. A sample that tries to trace itself and fails can tell it's being watched. sysdig and auditd observe from the kernel instead, so they're the ones to lean on when a sample seems shy. Run both kinds where you can.

A minimal auditd rule set for a detonation

# log every program execution (64-bit and 32-bit)
-a always,exit -F arch=b64 -S execve -k exec
-a always,exit -F arch=b32 -S execve -k exec
# log writes and attribute changes to places persistence likes
-w /etc/cron.d/ -p wa -k persist
-w /etc/systemd/system/ -p wa -k persist
-w /etc/ld.so.preload -p wa -k persist

Load these, take your clean snapshot, and after a run search the log with ausearch -k exec or ausearch -k persist.

Here's an illustrative, simplified excerpt of what strace -f -tt -o trace.txt ./sample.bin might record for a sample on the Linux victim (timestamps removed for width). Notice how the fake internet shows up:

1712 execve("./sample.bin", ["./sample.bin"], 0x7ffd5d3e1a40 /* 22 vars */) = 0
1712 openat(AT_FDCWD, "/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3
1712 connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.10.10.1")}, 16) = 0
1712 sendto(4, "\x8a\x1f\x01\x00\x00\x01...update-cdn\x07example...", 36, MSG_NOSIGNAL, NULL, 0) = 36
1712 recvfrom(4, "\x8a\x1f\x81\x80...\x0a\x0a\x0a\x01", 2048, 0, ...) = 52
1712 connect(5, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("10.10.10.1")}, 16) = 0
1712 write(5, "GET /cfg/stage2.bin HTTP/1.1\r\nHost: update-cdn.example\r\n...", 98) = 98

Line by line: it starts, reads the resolver configuration (which points at our gateway), sends a DNS query for update-cdn.example, gets back 10.10.10.1 (that's the \x0a\x0a\x0a\x01 at the end of the reply: bytes 10, 10, 10, 1), connects to that address on port 80, and requests a second stage. Every one of those facts goes in your report.

Not every Linux sample is x86

IoT malware is often compiled for ARM, MIPS or PowerPC, because that's what's inside routers and cameras. Your x86-64 victim can't run those directly. QEMU can emulate them, either as a full emulated machine or in "user mode", where qemu-arm or qemu-mips runs a single foreign binary. User-mode emulation passes the sample's system calls straight to the kernel it's running on, so it is not a sandbox: only ever run it inside the victim VM, never on your host.

Handling Samples Safely

Now the rituals for door number three: you.

The "infected" zip

By long-standing convention, malware is passed around inside a password-protected zip whose password is infected. Every MalwareBazaar download uses it, VirusShare uses it, and antivirus vendors ask customers to submit suspicious files the same way. The password isn't a secret. It does two jobs:

  1. It stops accidents. You can't double-click a sample that's still inside an encrypted archive. It has to be extracted on purpose, with a password, which gives you a moment to check you're in the right VM.
  2. It hides the sample from scanners. Your host's antivirus and your mail server can't read inside the encrypted archive, so they won't quarantine or delete it on the way in.

That second point cuts both ways: corporate mail gateways often block encrypted archives because they can't scan them. Keep your samples in the zip until they're inside the VM, and extract them only there:

7z x -pinfected sample.zip           # extract, inside the analysis VM only
7z a -tzip -pinfected -mem=AES256 out.zip sample.bin   # package a sample to share

Never double-click, and rename on arrival

Windows decides what to do with a file by its extension, and that's how most infections happen: someone double-clicks something. In the lab, take that option away:

  • Rename the extension so nothing will run it by accident: invoice.exe becomes invoice.exe_ or invoice.bin. Rename it back only at the moment you deliberately detonate it.
  • Name samples by their hash, which is what sample repositories do. A filename like 275a021b...fd0f.bin tells nobody to click it, and it can never be confused with another sample.
  • Turn on file extensions in Explorer (they're hidden by default) so that report.pdf.exe shows its real name.

Hash it the moment it arrives

A file's cryptographic hash is its fingerprint: change one bit and the hash changes completely. Before you do anything else with a new sample, hash it and write the hash down along with where it came from, when, and the original filename.

Hashing a test file on arrival

The EICAR test file is a harmless 68-byte string that antivirus products agree to detect as if it were malware. It's the perfect first "sample" to push through your lab's workflow, and to check Defender really is off inside the VM.

$ sha256sum eicar.com
275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f  eicar.com
PS> (Get-FileHash .\eicar.com).Hash      # SHA256 is the default
275A021BBFB6489E54D471899F7DB9D1663FC695EC2FE2A2C4538AABF651FD0F
$ md5sum eicar.com
44d88612fea8a8f36de82e1278abb02f  eicar.com
$ sha1sum eicar.com
3395856ce81f2b7382dee72602f798b642f14140  eicar.com

You'll still see MD5 and SHA-1 in older reports and lookups, but both have known collision attacks, so use SHA-256 as the canonical ID.

The hash is how you talk about a sample without passing it around. You can search VirusTotal, MalwareBazaar or your own notes for a hash without uploading anything, which matters a great deal in the operational security section below.

Defanging: making indicators unclickable

Your notes, tickets and reports will be full of malicious URLs, domains, IP addresses and email addresses. Write them as-is and something, somewhere, will turn them into live links: a chat app, a wiki, an email client that fetches a preview. Defanging rewrites them so they're still readable by a human but not clickable or resolvable by software:

Live (dangerous in a report)

https://login.example-bank.example/verify

203.0.113.7

[email protected]

Defanged

hxxps://login[.]example-bank[.]example/verify

203[.]0[.]113[.]7

billing[@]example[.]org

The common conventions are http → hxxp, . → [.] in hostnames and IPs, @ → [@] (or [at]), and sometimes :// → [://]. Different teams vary slightly, so a good "refanger" accepts all the common forms when you need to turn an indicator back into something a tool can use, inside the lab.

Defanger and Refanger

Paste one indicator per line, or a whole paragraph of notes. Everything is processed in your browser: nothing is looked up, fetched or turned into a link. Defanging only touches hostnames, IP addresses, email addresses and URL schemes, so a path like /cfg/stage2.bin keeps its dots.

Indicators found

Where to get samples, responsibly

You don't need to hunt for malware in the wild. Researchers share it through repositories built for the purpose:

  • MalwareBazaar, run by abuse.ch, is the friendliest starting point: samples are searchable by hash, family and tag, free to download within fair-use limits, and delivered as infected zips.
  • VirusShare is a very large corpus, but access is by invitation: you request an account and are approved (or not).
  • theZoo is a GitHub repository of live samples, including historical families, packaged as encrypted zips with a password file beside each. Its README is blunt that these are live, dangerous samples. Some families are worms that spread by themselves, so clone it only into the lab, and never onto a machine on your real network.

Start with well-documented, older families that have public write-ups you can check your findings against. And never pull something "interesting" out of your work inbox to practise on. That's a client or employer sample, which brings us to opsec.

Operational Security

Operational security ("opsec") is about what your analysis reveals, and to whom.

Don't upload client samples to public sandboxes. Services like VirusTotal, ANY.RUN's free tier, and Hybrid Analysis are wonderful, but uploads are, to varying degrees, shared: files on VirusTotal can be downloaded by its paying subscribers, and free-tier sandbox reports are public. That causes two problems. A malicious document attached to a targeted phishing email may contain your client's real names, invoices or internal data. And attackers watch these services for their own samples: the moment their custom implant appears, they know they've been discovered, and they may change tactics before you've finished cleaning up. Search by hash first; upload only what you're allowed to share.

Respect the Traffic Light Protocol. Threat intelligence is shared with a label that says how far it may travel. FIRST's TLP 2.0 (August 2022) has five:

TLP 2.0 labels

  • TLP:RED: for the named recipients only. Don't pass it on.
  • TLP:AMBER+STRICT: within the recipient's organisation only.
  • TLP:AMBER: within the recipient's organisation, and its clients where they need to know to protect themselves.
  • TLP:GREEN: within the wider community, but not publicly.
  • TLP:CLEAR: no restrictions; may be published.

A sample you received under TLP:AMBER doesn't go to a public sandbox, a blog post, or a GitHub repo, however interesting it is.

Keep the lab apart from your identity. Don't log into personal accounts from analysis VMs. Don't browse to malicious infrastructure from your normal browser to "see if it's still up"; use the lab, and the VPN egress if you must. Prefer a dedicated host, or at least a separate user account with full-disk encryption, for the lab.

The Pre-Detonation Checklist

Everything above, compressed into the list to run through every single time, before you execute anything. Print it, tape it to the monitor, and don't skip lines because you're in a hurry. Hurrying is when accidents happen.

  1. Right VM, clean state

    You're in the victim VM, not the host and not REMnux. It was just reverted to the CLEAN snapshot.

  2. Network is isolated, and you checked

    The adapter is on the internal lab network, not NAT or bridged. A quick test (ping a public IP, resolve a real domain) fails or hits the fake services.

  3. Integration doors are shut

    No shared folders mapped, shared clipboard off, drag-and-drop off, no USB devices passed through.

  4. Gateway is up and recording

    INetSim or FakeNet-NG is running, and a packet capture is running on the lab interface.

  5. Monitoring is running on the victim

    Process Monitor, or strace/sysdig/auditd on Linux, started before the sample.

  6. The sample is hashed and logged

    SHA-256 recorded with source, date and original name. You've searched for the hash before deciding to run it.

  7. Internet access is a decision, not an accident

    VPN egress is off, unless you've decided otherwise for this run, with a kill switch and a time limit.

  8. You know how it ends

    You know which results you'll export and how, and the run ends with a revert.

Once every box is ticked, rename the sample back to its real extension and run it.

What's Next

You now have a glovebox: two victim VMs (one Windows, one Linux) on a private network, a REMnux gateway faking the internet and recording everything, a clean-snapshot habit, and a set of handling rituals that keep samples encrypted, renamed, hashed and defanged until the moment you choose to run them.

Interestingly, the first thing you'll do with most samples is not run them. The next article in the series, on static triage, covers what you can learn from a file without ever executing it: its hashes, strings, imports, and the structure of the executable itself. It's safer, faster, and often tells you what to watch for when you do finally detonate.