Speakeasy
Speakeasy is an open source Windows malware emulation framework from Mandiant. Its main goal is "high resolution emulation of the Windows operating system for dynamic malware analysis for the x86 and amd64 platforms." It runs user-mode executables and DLLs, kernel-mode drivers, and shellcode.
Speakeasy does not run the real Windows DLLs. Python handlers model the Windows APIs, and the sample interacts with an emulated file system, network, and registry. As a sandbox, this gives less noise than a full system: "the only activity that can be recorded is either written by the malware author, or statically compiled within the binary." Each API call, file operation, and network request goes into a JSON report. When a sample needs an API or a part of the system that Speakeasy does not model, the run can stop early or go a different way. For these samples, use a full system sandbox such as VMRay.
Speakeasy is licensed under the MIT license. The source is at github.com/mandiant/speakeasy, and the Python package is speakeasy-emulator. For background, see the Mandiant blog post Emulation of Malicious Shellcode With Speakeasy.
How the add-on uses Speakeasy
The add-on installs Speakeasy as a Python package in IDA's Python environment and runs the speakeasy command as a separate process. The sample runs in the emulator, never on your system, as described in Isolation. Network requests get decoy replies from the emulated network and do not go to the real network.
Speakeasy is the emulator for isolated system emulation. The add-on starts Speakeasy with its GDB server and connects IDA's remote GDB debugger to it. It also tells Speakeasy to treat all modules and API functions as present. When the sample calls an API that Speakeasy does not model, the call returns 1 and the session continues.
For sandbox integration, select Extensions → Malware Analysis → Sandbox → Run Speakeasy sandbox. The add-on runs the sample in Speakeasy with memory tracing and code coverage turned on, then shows the report in the trace view. To show a report that you made before, select Malware Analysis → Sandbox → Load Speakeasy report (.json).... The emulation_timeout, emulation_max_total_time, emulation_max_api_count, and emulation_max_instructions settings limit the run.
For automated unpacking, set default_debugger to speakeasy. The unpacker then starts Speakeasy through the isolated system emulator and runs its heuristics on the emulated process.
If you have a question, an idea, or a problem, email support@hex-rays.com. The Malware Analysis team reads every message and replies quickly.
Last updated
Was this helpful?
