Why analyze malware at all?
A detection that only says something is bad leaves big questions open. Which files did it change? Which addresses does it contact? Did it steal credentials, and which ones? Can it spread to other machines? Analysis answers those questions and produces indicators of compromise, such as file hashes, domains, mutex names and registry or file paths, that let you search other systems for the same infection. It also feeds detection rules, so the next copy is caught automatically.
What are the main approaches?
| Approach | What you do | Strength | Limit |
|---|---|---|---|
| Static, basic | Hash, file type, strings, imports, packer detection | Fast, no execution risk | Packed or encrypted samples reveal little |
| Static, advanced | Disassembly and decompilation | Shows the full logic, including unused paths | Slow, needs reverse engineering skill |
| Dynamic | Run the sample in an isolated VM and record behavior | Shows real actions quickly | Samples may detect the sandbox and stay quiet |
| Memory | Capture and examine RAM from an infected system | Finds unpacked code and hidden processes | Needs a timely capture |
Most investigations combine them: a quick static triage, a sandbox run, then deeper reversing only for the parts that matter.
What does a first static triage look like?
sha256sum sample.bin file sample.bin strings -n 8 sample.bin | grep -Ei 'http|\.onion|/bin/sh|wget|curl|User-Agent' | head -30 readelf -h -d sample.bin 2>/dev/null | head -25 yara -s rules/linux_miners.yar sample.bin
The hash identifies the sample and lets you search threat feeds. file and readelf reveal the format, architecture and linked libraries; a statically linked ELF with almost no readable strings is often packed. YARA matches patterns that describe known families. Keep the sample in a password-protected archive when it is not being worked on, the usual convention being the password infected, so nothing executes or gets scanned by accident.
How do I build an isolated lab on a dedicated machine?
A bare metal host with plenty of RAM makes a good lab, because you run every sample inside virtual machines that you can snapshot and roll back. A typical layout:
- Install Proxmox VE or KVM with libvirt on the host.
- Create an isolated bridge with no uplink, for example
vmbr9with no physical port, for the analysis VMs. - Run a second VM on that bridge that fakes internet services (DNS, HTTP, SMTP) with tools like INetSim, so samples believe they are online and reveal their callbacks.
- Snapshot clean Linux and Windows guests and revert after every run. Bring your own licenses for any commercial guest systems.
- Reach the lab only through SSH or a VPN to the host, never by exposing guest consoles publicly.
qm snapshot 210 clean-base --description "fresh guest before detonation" qm start 210 # ... run the sample, collect logs and a pcap from the isolated bridge ... qm stop 210 && qm rollback 210 clean-base
If you deliberately allow a sample real internet access to observe live command servers, you take responsibility for anything it does from your address. Keep such runs short, rate limited and closely watched, and never let a sample send mail or attack others; fair use rules apply to lab traffic too.
What should a dynamic run record?
- Processes started, with command lines (auditd or eBPF tools on Linux guests, Sysmon on Windows guests).
- Files created, modified or deleted, and persistence such as cron entries, services or startup keys.
- Network activity: DNS lookups, connection attempts and full packet captures from the bridge with
tcpdump -i vmbr9 -w run-042.pcap. - Memory images of the guest, for later study with Volatility.
How are findings written up?
A useful report answers the questions responders will ask first: what the sample is, how it gets in, what it does once running, how it persists, how it communicates, and how to detect and remove it. List indicators in a machine-readable block so they can be loaded into firewalls, DNS filters and search tools, and record the hashes of every related file. Share indicators with trusted peers or a sector group where appropriate; the same campaign often hits many organizations within days, and early warning helps everyone.
Which open source tools are common?
- Ghidra and radare2: disassembly and decompilation.
- YARA: pattern rules for classifying samples.
- Volatility 3: memory forensics.
- CAPE: an automated sandbox that runs samples and writes behavior reports.
- Wireshark and Zeek: traffic analysis.
- ClamAV: signature scanning, handy for quick checks on servers.
Which hardware suits a lab?
Memory and fast storage matter most, since many snapshotted guests run side by side. The S5 with 128 GB DDR4 and 2x 1 TB NVMe runs a compact lab, the D5 with 256 GB DDR4 and 16 cores handles parallel sandboxes, and a high memory model like the M1 with 512 GB DDR4 suits teams processing many samples a day. Virtualization hosts covers hypervisor sizing.
Memory-Rich Hosts for an Analysis Lab
| Server | Processor | Cores / threads | Memory | Storage | Network | Per month | Smallest order |
|---|---|---|---|---|---|---|---|
| S5 | Intel Xeon E-2276G | 6 / 12 | 128 GB DDR4 | 2x 1 TB NVMe | 2x 10 Gbps | $88.72 | $88.72 (1 month) |
| S12 | Intel Core i9-14900K | 24 / 32 | 192 GB DDR5 | 2x 4 TB NVMe | 2x 10 Gbps | $202.82 | $202.82 (1 month) |
| D5 | 2x Intel Xeon Gold 5315Y | 16 / 32 | 256 GB DDR4 | 2x 2 TB NVMe | 2x 25 Gbps | $305.34 | $305.34 (1 month) |
| M1 | 2x Intel Xeon Gold 5315Y | 16 / 32 | 512 GB DDR4 | 2x 4 TB NVMe | 2x 25 Gbps | $414.70 | $414.70 (1 month) |
Keep Reading
Malware
Software written to harm, spy on or take over systems: the main families, how each reaches a Linux server and what keeps it out.
OpenVirtualization hosts
Carve one physical box into many virtual machines with Proxmox VE or KVM, guests behind NAT on a single public address.
OpenProxmox VE
Proxmox VE 8 turns an x86 machine into a virtualization host with a web console for VMs and containers.
OpenFile Hash
A short fingerprint computed from a file, how it proves downloads and backups are intact, and the commands to create and verify one.
OpenFAQ
Quick Answers
Static analysis examines a file without running it. Dynamic analysis runs it in an isolated environment and records what it does.
Yes, inside isolated virtual machines with no route to the internet. Samples must never be allowed to attack or spam others from your address.
Concrete traces of an infection, such as file hashes, domains, addresses and file paths, that help find the same malware elsewhere.
Many check for signs of virtualization or analysis tools and stay dormant. Realistic guests and longer runs help.
Proxmox VE or plain KVM on Linux. Both support snapshots and isolated bridges with no physical uplink.