You can assemble a malware analysis lab from free tools, starting with virtual systems that run Windows and REMnux on an isolated network. Add behavior and code analysis tools such as Process Monitor, x64dbg, and Ghidra, along with online sandboxes and an AI agent that can interact with many of the tools on your behalf.
Examining the capabilities of malicious software allows you to better assess the nature of a security incident, and may help prevent further infections. Here’s how to set up a controlled malware analysis lab—for free.
- Step 1: Allocate systems for the analysis lab
- Step 2: Isolate laboratory systems from the production environment
- Step 3: Install behavioral analysis tools
- Step 4: Install code-analysis tools
- Step 5: Take advantage of online analysis tools
- Consider adding an AI agent to the lab
- Next Steps
Cyber intrusions often involve some form of malware. When investigating the incident, the responder typically seeks to answer questions such as: What actions can the malware perform on the system? How does it spread? How, if at all, does it maintain contact with the attacker? These questions can all be answered by analyzing the offending malware in a controlled environment.
A simple analysis toolkit, built from free and readily available software, can help you and your team develop the skills critical to responding to security incidents. The steps below will help get you started. We’ll focus on malware analysis in a Windows environment, since that platform is particularly popular among malware authors. If this topic interests you, take a look at the reverse-engineering malware course I teach at SANS Institute.
Step 1: Allocate systems for the analysis lab
A common approach to examining malware involves infecting a system with the malware sample and then using the appropriate monitoring tools to observe how it behaves. This requires a laboratory system you can infect without affecting your production environment.
The most popular and flexible way to set up such a lab system involves virtualization software, which allows you to use a single physical computer for hosting multiple virtual systems, each running a potentially different operating system. Free virtualization software options include:
Running multiple virtual systems simultaneously on a single physical computer is useful for analyzing malware that seeks to interact with other systems, perhaps for leaking data, obtaining instructions from the attacker, or upgrading itself. Virtualization makes it easy to set up and use such systems without procuring numerous physical boxes.
To examine Windows malware, plan for at least two systems in your lab. One should run Windows, which is where you’ll execute the sample and observe its behavior. The other can run REMnux, a free Linux toolkit for malware analysis.
Another useful feature of many virtualization tools is the ability to take instantaneous snapshots of the laboratory system. This way, you can record the state of the system before you infect it, and revert to the pristine environment with a click of a button at the end of your analysis.
Install as much RAM into your system as you can, as the availability of memory is arguably the most important performance factor for virtualization tools. In addition, having a large disk will allow you to host many virtual machines, whose virtual file systems typically are stored as files on the physical system’s disk.
To allow malware to reach its full potential in the lab, laboratory systems typically are networked with each other. This helps you observe the malicious program’s network interactions. If using physical systems, you can connect them with each other using an inexpensive hub or a switch. If using virtual machines, you can connect them over a host-only virtual network, which is isolated from the internet.
Step 2: Isolate laboratory systems from the production environment
You must take precautions to isolate the malware-analysis lab from the production network, to mitigate the risk that a malicious program will escape. You can separate the laboratory network from production using a firewall. Better yet, don’t connect laboratory and production networks at all, to avoid firewall configuration issues that might allow malware to bypass filtering restrictions.
If your laboratory network is strongly isolated, you can use removable media to bring tools and malware into the lab. Consider using write-protectable USB keys to prevent malicious software from escaping the lab’s confines by writing itself to a writable removable disk.
Some malware-analysis scenarios benefit from the lab being connected to the internet. Avoid using the production network for such connectivity. If possible, provision a separate, and usually inexpensive, internet connection. Avoid keeping the lab connected to the internet all the time to minimize the chance of malware in your lab attacking someone else’s system on the internet. For one practical way to connect the lab’s systems, including a temporary path to the internet, see my post Designing a Malware Analysis Lab With REMnux.
Be sure to keep up with security patches released by the virtualization vendor. Such software may have vulnerabilities that could allow malware to escape from the virtual system you infected and onto the physical host. Furthermore, don’t use the physical machine that’s hosting your virtualized lab for any other purpose.
Step 3: Install behavioral analysis tools
Before you’re ready to infect your laboratory system with the malware sample, you need to install and activate the appropriate monitoring tools. Free utilities that will let you observe how Windows malware interacts with its environment include:
- File system and registry monitoring: Process Monitor with ProcDOT offer a powerful way to observe how local processes read, write, or delete registry entries and files. These tools can help you understand how malware attempts to embed into the system upon infection.
- Process monitoring: Process Explorer and System Informer replace the built-in Windows Task Manager, helping you observe malicious processes, including local network ports they may attempt to open.
- Network monitoring: Wireshark is a popular network sniffer, which can observe laboratory network traffic for malicious communication attempts, such as DNS resolution requests, command-and-control traffic, or downloads.
- Change detection: Regshot is a lightweight tool for comparing the system’s state before and after the infection, to highlight the key changes malware made to the file system and the registry.
- Network services: fakedns and INetSim are services you can start on REMnux to respond to the sample’s DNS queries and network connections, so you can observe what the sample does after it connects.
Behavioral monitoring tools can give you a sense for the key capabilities of malicious software. For further details about its characteristics, you may need to roll up your sleeves and perform some code analysis.
Step 4: Install code-analysis tools
Examining the code that comprises the sample helps uncover characteristics that may be difficult to obtain through behavioral analysis. In the case of a malicious executable, you rarely will have the luxury of access to the source code from which it was created. Fortunately, the following free tools can help you reverse compiled Windows executables:
- Disassembler and debugger: x64dbg and Ghidra can parse compiled Windows executables and, acting as disassemblers, display their code as assembly instructions. Such tools may also have debugging capabilities, which allow you to execute the most interesting parts of the malicious program slowly and under highly controlled conditions, so you can better understand the purpose of the code. Ghidra also includes a decompiler, which presents the code in a form that resembles source code.
- Emulator: Speakeasy, which is available on REMnux, executes the sample’s code in a simulated Windows environment. This way, you can preview the sample’s capabilities without infecting the laboratory system.
- Memory dumper: Scylla and OllyDumpEx help obtain protected code located in the lab system’s memory and dump it to a file. This technique is particularly useful when analyzing packed executables, which are difficult to disassemble because they encode or encrypt their instructions, extracting them into RAM only during run-time.
Many of the tools for examining code and other aspects of suspicious files without executing them are preinstalled as part of the REMnux toolkit. The categorized listing of REMnux tools is useful for determining which utilities can help you with malware analysis.
Step 5: Take advantage of online analysis tools
To round off your malware-analysis toolkit, add to it some freely available online tools that may assist with the reverse engineering process. One category of such tools performs automated behavioral analysis of the executables you supply. These applications look similar at first glance, but use different technologies on the back end. Consider submitting your malware sample to several of these sites; depending on the sample, some sites will be more effective than others. Such tools include:
Be careful not to submit sensitive files to these sites, because other researchers and, potentially, threat actors might be able to access the files that people upload there. Looking up the file’s hash on these sites is safer than uploading the file.
You can see a longer list of free automated malware analysis services that can examine compiled Windows executables. Another set of potentially useful online tools provides details about websites that are suspected of hosting malicious code. You can see some of them on my page Free Online Tools for Looking up Potentially Malicious Websites.
Consider adding an AI agent to the lab
An AI agent with access to your analysis tools can run many of them on your behalf, interpret their output, and draft initial findings for you to verify. REMnux comes with OpenCode, an open-source AI agent, and the REMnux MCP server. The MCP server connects the agent to the tools on REMnux and provides guidance on which tools to run and how to interpret their output.
The agent will need access to an AI model, which in most setups is a remote service that you might need to pay for. The agent will send details about the sample to that service, so use an AI provider that’s consistent with your organization’s expectations.
Run the agent inside the lab, because the sample might contain text designed to manipulate it (prompt injection). Allow only the network connections the agent needs, such as the one to the AI model. On REMnux, you can do this using the restrict-egress script.
Treat the agent’s findings as theories to confirm using the tools from the earlier steps. My AI-Assisted Malware Analysis Tips cheat sheet explains how to direct an agent and verify its findings.
Next Steps
With your initial toolkit assembled, start experimenting in the lab with malware you come across on the web, in your e-mail box, on your systems, and so on. There are several “cheat sheets” that can help you in this process, including:
- Analyzing Malicious Software
- Analyzing Malicious Documents
- Reverse-Engineering Malicious Code
- REMnux Usage Tips
Begin analysis with the tools and approaches most familiar to you. Then, as you become more familiar with the inner workings of the malware sample, venture out of your comfort zone to try other tools and techniques. Many of the tools I’ve listed within each step have similar capabilities. Since they’re all free, you should feel free to try them all. You’ll find that one tool will work better than another, depending on the situation. And with time, patience, and practice, you will learn to turn malware inside out. For additional tips and resources, see my articles Mastering 4 Stages of Malware Analysis and How You Can Start Learning Malware Analysis, and check out the Reverse-Engineering Malware course I teach at SANS Institute.