Print-ready version Back to the article
HMMNM Security
hmmnm.com

Security

How to Reverse a Ransomware Sample Safely: Static Triage with capa, FLOSS and PEStudio in a FLARE-VM Lab

By Prabhu Kalyan Samal | Published 2 December 2026 | 13 min read

https://hmmnm.com/how-to-reverse-a-ransomware-sample-safely-static-triage-with-capa-floss-and-pestudio-in-a-flare-vm-lab/

13 min read · 2,550 words

Yes—you can analyze ransomware without executing it. Static triage in an isolated FLARE-VM lab using capa, FLOSS and PEStudio reveals capabilities, obfuscated strings and the encryption routine with zero detonation risk, provided you verify isolation before the sample ever touches disk.

TL;DR: You can triage ransomware without running it — here’s how

Static analysis answers the questions that matter most in the first hour of incident response: what does this binary do, how does it encrypt, and what indicators can you push to detection engineering today? capa maps behaviors, FLOSS recovers strings that packers try to hide, and PEStudio exposes the PE structure, imports and entropy that tell you whether you’re looking at a vanilla loader or a heavily armored sample. None of it requires you to click “Run.” The Mandiant FLARE team built FLARE-VM precisely for this workflow—and if you follow the isolation discipline below, your host and your production network stay out of harm’s way.

Lab setup: Building and isolating FLARE-VM

FLARE-VM is Mandiant’s (now part of Google Cloud) free Windows-based reverse engineering distribution. It installs a curated toolset—PEStudio community edition, FLOSS, capa, x64dbg, IDA Free or Ghidra if you add them, plus dozens of utilities—onto a Windows 10 virtual machine. It is the de facto standard lab for malware analysts, and CISA’s own malware analysis reports assume exactly this kind of environment.

Build it like this:

  1. Create a Windows 10 x64 VM in VMware Workstation, VirtualBox or Hyper-V. Allocate at least 2 CPU cores, 4 GB RAM and an 80 GB disk—FLARE-VM’s installer is hungry.
  2. Install the OS, take a clean snapshot before installing FLARE-VM, then run the FLARE-VM installer from github.com/mandiant/flare-vm. It takes 30–60 minutes.
  3. After installation and patching, take another snapshot. This is your “golden” state—every analysis session starts here and ends with a revert.
  4. Disable shared folders, drag-and-drop and clipboard sharing in the hypervisor settings. Ransomware that escapes via a mounted share is not hypothetical—it’s documented in real incidents.
  5. Set the network adapter to host-only (or no network at all for pure static work). Verify isolation from inside the guest: ping nothing, confirm the adapter has no route to your production subnet, and confirm the host’s other VMs are unreachable.

Static triage needs no internet access. Resist the temptation to leave the VM networked “just in case”—you can copy results out via a transient shared folder that you re-disable immediately afterward, or use a snapshot-revert workflow where nothing you care about lives inside the guest.

Safety first: Handling and hashing the sample

Before any tool touches the binary, handle it correctly. Ransomware samples are distributed as password-protected ZIP archives—typically password infected—precisely so antivirus on the download path doesn’t detonate or quarantine them. Keep it that way until the file is inside the isolated VM.

Follow this discipline every single time:

Document the acquisition date, source, hash and archive password in your session notes. Every professional analysis report starts with this chain of custody.

First-pass recon with PEStudio

Open the sample in PEStudio first—nothing executes on load, which is why it anchors most triage workflows. Work through these panels in order:

If entropy is uniformly high and imports are skeletal, note it: capa will likely underperform on the packed payload, and you’ll need to interpret results accordingly.

Recovering hidden strings with FLOSS

Plain strings only sees statically declared text. Modern ransomware families—Conti, LockBit derivatives, BlackCat—build strings on the stack character by character at runtime, invisible to naive extraction. FLOSS (FireEye Labs Obfuscated String Solver), from the same Mandiant team, emulates the binary with the SLEIGH-based engine underlying Ghidra and deobfuscates these stack strings automatically.

Run it from a command prompt:

floss.exe sample.exe --only stack tight functions > floss_output.txt

Then grep the output for the ransomware telltales:

Every one of these is an IOC candidate. Log them with context—which FLOSS output section they came from—because stack strings recovered via emulation carry more analytical weight than coincidental byte sequences.

Mapping capabilities with capa

capa is Mandiant’s capability enumeration engine. It matches behaviors—API call patterns, constants, instruction sequences—against hundreds of community rules and reports what the binary does, expressed in MITRE ATT&CK technique language. This is how capa identifies ransomware capabilities: it recognizes the API sequences and cryptographic constants that constitute behaviors like file encryption, key generation and persistence, then maps each to ATT&CK techniques such as T1486 (Data Encrypted for Impact) and T1490 (Inhibit System Recovery).

Run it:

capa.exe sample.exe -v > capa_report.txt

For ransomware, expect rule hits like:

Two interpretation notes. First, capa reports mitigations when confidence is low—if it says results are limited because the binary is packed, trust it and cross-check entropy in PEStudio. Second, capa’s rule database is extensible; the ransomware-specific rules from Mandiant’s public repository frequently catch family-specific builder quirks that generic rules miss. The project lives at github.com/mandiant/capa.

Identifying the encryption routine

This is where the three tools converge. Ransomware almost universally uses hybrid encryption: a symmetric cipher (AES, ChaCha20, sometimes legacy RC4/RSA-only in older families) encrypts file contents, while an asymmetric key (RSA, ECC/ECIES) encrypts the symmetric key itself—so only the attacker’s private key can restore anything.

Cross-reference to find the routine:

  1. Start in PEStudio’s imports panel. Filter for crypto APIs. CryptAcquireContext with PROV_RSA_AES, CryptDeriveKey, CryptEncrypt indicates CryptoAPI symmetric encryption; CryptImportKey with a large embedded blob often means an embedded RSA public key.
  2. Pull the matching capa hits. capa’s verbose output (-v or -vv) gives you the addresses where each rule matched. Note the function addresses for “encrypt data using AES” and “generate random encryption key.”
  3. Jump to those addresses in PEStudio’s disassembly view (or export to Ghidra/IDA for deeper work). You’re looking for the encryption loop: ReadFile → buffer → AES block operations → WriteFile, with the extension-append and note-drop logic nearby.
  4. Distinguish the layers. The asymmetric operation (RSA encryption of a small buffer—the session key) typically happens once per run or per file and calls into different functions than the bulk symmetric loop. Per-file RSA wrapping is the stronger ransomware design because it defeats naive key recovery; identifying which layer is which tells you whether a recovered key from incident response could actually decrypt anything.

Look for known AES tables or S-box constants in PEStudio’s strings/bytes view—capa flags these too—and for hardcoded RSA public key blobs (large runs of high-entropy data near crypto imports). That embedded public key is often your config extraction entry point.

Extracting ransomware configuration data

Most modern families carry an embedded configuration blob written by the affilate-facing builder: extension lists, note text, C2 URLs, payment amounts, victim ID formats, termination deadlines. Extracting it statically is high-value because the config is both an IOC goldmine and the input for detection signatures.

Practical approaches:

Document every extracted element—extension list, wallet addresses, C2 endpoints, note text—with the offset or function address it came from. Detection engineering needs provenance, not just values.

Turning findings into detections

Triage output becomes operational value when you convert it into signatures:

Validate everything against the capa report before publishing. If your YARA rule fires on strings capa can’t correlate to a real behavior, you may have built a false-positive machine.

Common pitfalls and when static analysis isn’t enough

Static triage has hard limits. Know them before they cost you a day:

When you hit these walls, graduate to controlled dynamic analysis in the same VM: revert to the golden snapshot, re-enable host-only networking, use a monitoring stack (Procmon, API Monitor, Wireshark on the host-only interface) and detonate deliberately, not accidentally. Snapshot discipline is what makes this safe—every dynamic session is disposable.

Practice safely: Sample sources and next steps

You can’t build this skill without samples, and there are legitimate sources:

Close every session the same way: document hashes, findings, tool versions and rule outputs in your notes; export your YARA/SIGMA artifacts out of the VM; then revert to the golden snapshot. A lab that stays clean is a lab you can trust the next time a sample lands—because with ransomware, it’s never a question of if.

Frequently Asked Questions

Is it safe to analyze ransomware in a VM?

Yes—if properly isolated. Use host-only networking, disable shared folders and clipboard sharing, take clean snapshots, and keep the sample password-protected until it’s inside the guest. If you only perform static analysis, detonation risk is minimal; the real danger comes from dynamic execution in a misconfigured VM, which is why snapshot discipline is non-negotiable.

What is the difference between capa and FLOSS?

FLOSS deobfuscates and extracts strings, including stack strings that packers and ransomware build at runtime. capa matches binary behaviors against a community ruleset to report capabilities—file encryption, persistence, anti-analysis—mapped to MITRE ATT&CK techniques. They complement each other: FLOSS recovers the text, capa identifies the behavior.

Do I need a license for PEStudio?

No. The free version covers most triage needs: headers, imports, sections, entropy, flags and basic disassembly. The paid version adds advanced features like variant hunting, extended blacklists and deeper analysis—useful for full-time malware analysts, unnecessary for triage.

What if capa returns no results on my sample?

The sample is most likely packed or obfuscated. Check entropy and import sparseness in PEStudio to confirm, identify the packer with Detect It Easy, consider unpacking in x64dbg first, or run capa against the unpacked payload. You can also rerun capa with the vulnerability and anti-analysis rule scopes enabled, which sometimes surface matches even on armored binaries.

Where can I legally get ransomware samples to practice on?

MalwareBazaar, the Malware-Traffic-Analysis.net exercise files, and CTF archives like Flare-On provide samples for research use. Always handle them in an isolated lab—host-only networking, snapshots, no shared folders—and respect each source’s usage terms.

HMMNM Security · Independent security research and education · hmmnm.com
Printed from https://hmmnm.com/how-to-reverse-a-ransomware-sample-safely-static-triage-with-capa-floss-and-pestudio-in-a-flare-vm-lab/
© 2026 HMMNM Security. For personal and internal team use. Please link to the original article when sharing.