Building a Cuckoo lab with two Windows VMs and YARA

A practical lab journal covering Cuckoo 2.0.7, vSphere-driven guest orchestration, Windows 7/10 analysis machines, PCAP troubleshooting, external YARA rules, and a verified recent ransomware-family detection.

By Ashraf GamalUpdated 12 October 2026Cuckoo 2.0.7 · Python 2.7Approx. 8 min read

Personal note: This article reflects my experience and is for educational purposes only—not official vendor guidance. Always verify procedures against current vendor documentation.

Cuckoo Sandbox architecture: vSphere and ESXi orchestration, Windows 7 and Windows 10 analysis VMs, YARA rules, analysis flow, and reporting outputs
Architecture overview: Cuckoo manages both Windows guests through vSphere, evaluates YARA content, and preserves analysis artifacts.
Scope and accuracy

This article records the actual troubleshooting and validation outcomes from a legacy lab. It is not a recommendation to deploy Cuckoo 2.x as a new production service. Document-analysis support and vSphere remote control remained incomplete.

1. Objective

The objective was to validate an automated malware-analysis pipeline: accept a sample, let Cuckoo ask VMware vSphere to manage a Windows guest, revert to a clean snapshot, communicate with Cuckoo Agent, execute the sample, collect telemetry, run YARA, and produce a web/JSON report.

2. Architecture and prerequisites

ComponentObserved configurationRole
Cuckoo hostUbuntu/Linux; Cuckoo 2.0.7 in Python 2.7 virtualenvScheduler, analyzer coordination, processing and UI.
vSphereHTTPS/443 endpointVM lifecycle and snapshot operations.
Windows 7win7; label Cuckoo-Win7; 10.250.50.20Analysis guest.
Windows 10win10; label Cuckoo-Win10; 10.250.50.30Analysis guest.
Result server10.250.50.10:2042Receives guest telemetry.
Network captureens192tcpdump interface in this lab.
ReportingMongoDB 3.6.3; Django 1.8.4; port 8000Persist and review reports.
YARAPython binding 3.6.3; system CLI 3.7.1Rule matching and validation.

These host/guest values reflect the lab output. Replace them with your own topology and consider redacting internal IP ranges before publication.

Cuckoo Sandbox web interface evidence
MAL-SS-01 — Cuckoo Sandbox interface evidence.

3. Configure the two vSphere machines

The configuration file was ~/.cuckoo/conf/vsphere.conf. The machine identifiers in machines correspond to configuration section names; each label must match the VM name Cuckoo should control.

[vsphere]
host = <VSPHERE_HOST>
port = 443
user = <VSPHERE_SERVICE_ACCOUNT>
pwd = <STORE_SECRET_SECURELY>
machines = win7,win10
interface = ens192
unverified_ssl = yes

[win7]
label = Cuckoo-Win7
platform = windows
snapshot = clean
ip = 10.250.50.20
interface = ens192
resultserver_ip = 10.250.50.10
resultserver_port = 2042
tags = 64bit

[win10]
label = Cuckoo-Win10
platform = windows
snapshot = clean
ip = 10.250.50.30
interface = ens192
resultserver_ip = 10.250.50.10
resultserver_port = 2042
tags = 64bit

The real service-account password is intentionally omitted; it appeared in a terminal excerpt during troubleshooting. Rotate it if it was exposed beyond an approved administrative channel. Also note that unverified_ssl = yes disables certificate verification in this legacy configuration; use a trusted certificate for hardened deployments.

Configuration values were inspected with:

grep -E '^\[vsphere\]|^machines|^\[win7\]|^label|^\[win10\]' ~/.cuckoo/conf/vsphere.conf
cat ~/.cuckoo/conf/vsphere.conf | grep -v '^#' | grep -v '^$'

A separate libvirt ESX-driver diagnostic was used to list snapshots; it should not be mistaken for Cuckoo's internal vSphere connection:

virsh -c "esx://<VSPHERE_USER>@<VSPHERE_HOST>/?no_verify=1" snapshot-list "Cuckoo-Win7"
virsh -c "esx://<VSPHERE_USER>@<VSPHERE_HOST>/?no_verify=1" snapshot-list "Cuckoo-Win10"
Cuckoo lab evidence capture MAL-SS-02
MAL-SS-02 — supplementary implementation evidence.
Cuckoo lab evidence capture MAL-SS-02 (2)
MAL-SS-02 (2) — additional environment or task evidence.
Cuckoo lab evidence capture MAL-SS-02 (3)
MAL-SS-02 (3) — additional environment or task evidence.

4. Validate the analysis lifecycle

The useful proof was the scheduler/guest log sequence. A successful task acquired the VM, reverted the clean snapshot, detected Cuckoo Agent 0.10, uploaded the analyzer, received guest output, and powered off the guest after completion.

INFO: Using "vsphere" as machine manager
INFO: Task #7: acquired machine win10 (label=Cuckoo-Win10)
INFO: Reverting machine Cuckoo-Win10 to snapshot clean
INFO: Guest is running Cuckoo Agent 0.10
INFO: win10: analysis completed successfully
INFO: Powering off virtual machine Cuckoo-Win10
INFO: Task #7: reports generation completed
Cuckoo analysis task execution and diagnostic evidence
MAL-SS-04 — analysis execution / diagnostic evidence.

The completed Task #7 generated analysis.log, cuckoo.log, dump.pcap, files.json, BSON logs, reports/report.json, screenshots, task.json, and other artifacts under ~/.cuckoo/storage/analyses/7/.

Cuckoo task result and analysis output evidence
MAL-SS-05 — supplementary task-result evidence.
Cuckoo analysis process and reporting evidence
MAL-SS-06 — analysis process and reporting evidence.
MongoDB and Cuckoo report persistence evidence
MAL-SS-08 — MongoDB / reporting evidence.

Run one scheduler and one UI

A second Web UI launch failed with Error: That port is already in use; several detached screen sessions were also present. Inspect processes and listeners before starting another instance:

screen -ls
ps aux | grep '[c]uckoo'
ss -lntp | grep -E ':8000|:2042'

For manual lab operation, run the engine and web interface in separate sessions, as the dedicated cuckoo user:

# Session 1
su - cuckoo
source ~/cuckoo-env/bin/activate
screen -S cuckoo
cuckoo
# Detach with Ctrl+A, then D

# In a second SSH session
su - cuckoo
source ~/cuckoo-env/bin/activate
screen -S cuckoo-web
cuckoo web --host 0.0.0.0 --port 8000
# Detach with Ctrl+A, then D

Keep a single scheduler for the configured VM pool. MongoDB and guacd are separate systemd services, not extra Cuckoo screens.

5. Troubleshoot PCAP creation: AppArmor

Early tasks completed without a usable PCAP. Kernel audit logs showed AppArmor—not just Unix ownership—denying tcpdump permission to create dump.pcap:

apparmor="DENIED" operation="mknod"
profile="/usr/sbin/tcpdump"
name="/home/cuckoo/.cuckoo/storage/analyses/3/dump.pcap"

The local profile include was /etc/apparmor.d/local/usr.sbin.tcpdump. After correcting a syntax error and allowing the required storage path, the profile was reloaded:

/home/cuckoo/.cuckoo/storage/ r,
/home/cuckoo/.cuckoo/storage/analyses/ rw,
/home/cuckoo/.cuckoo/storage/analyses/** rw,
apparmor_parser -r /etc/apparmor.d/usr.sbin.tcpdump
tcpdump -i ens192 -c 3 -w /home/cuckoo/.cuckoo/storage/analyses/tcpdump-test.pcap

The direct test reported 3 packets captured, 3 packets received by filter, and 0 packets dropped by kernel. A later Cuckoo analysis also generated a task-level dump.pcap. Keep AppArmor enabled and add narrow path permissions rather than disabling the profile.

Cuckoo and YARA command line validation evidence
MAL-SS-07 — command-line validation evidence.

6. Integrate external YARA rules

The Cuckoo startup code walked these directories under its YARA root: binaries, urls, memory, scripts, shellcode, dumpmem, and office. Rule files for executable samples were kept under the active yara/binaries tree.

cd /tmp
git clone --depth 1 https://github.com/reversinglabs/reversinglabs-yara-rules.git
git clone --depth 1 https://github.com/Neo23x0/signature-base.git

find /tmp/reversinglabs-yara-rules -type f \( -name "*.yar" -o -name "*.yara" \) | wc -l
find /tmp/signature-base/yara -type f \( -name "*.yar" -o -name "*.yara" \) | wc -l

The clone counts were 310 ReversingLabs rule files and 750 Signature-Base files. The CLI compatibility test recorded:

SourceFiles testedCompatible in CLI testFailed
ReversingLabs3103100
Neo23x0 Signature-Base75071832

These results describe that test run, not a general guarantee. The system YARA CLI was 3.7.1 while Cuckoo's Python binding reported 3.6.3, so the CLI pass alone did not prove compatibility inside Cuckoo. Test rules with the same Python binding and provide any required external variables. Some Signature-Base rules depend on variables supplied by upstream scanning tools.

The files were copied into a nested directory such as ~/.cuckoo/yara/binaries/signature-base/tmp/signature-base/yara/. Cuckoo's code recursively walks category directories, but a clean, documented layout is easier to maintain. Verify the startup log after changing rule paths and avoid blindly overwriting bundled rules.

YARA rule validation summary evidence
MAL-SS-09 — YARA rule validation summary.

7. Validate detection with a recent ransomware sample

A Windows PE sample associated with The Gentlemen ransomware was submitted through the Cuckoo Web Interface. The report displayed the YARA match MAL_RANSOM_Gentlemen_Jun26_1, described as detecting The Gentlemen ransomware Windows locker (Storm-2697), a self-propagating Go-based encryptor.

This is direct evidence that the locally loaded family rule matched the submitted sample. The same report gave a Cuckoo score of 2.0/10 and displayed additional behavioral signatures, including command-line output and Windows API use associated with cryptographic key generation. The score is not a probability and should not override a family-specific YARA match; interpret static detections, behavioral signatures, and network artifacts together.

An earlier benign calc.exe task completed successfully, processed 542 Cuckoo signatures, matched antivm_disk_size, checks_debugger and has_pdb, and generated screenshots, JSON report artifacts and a PCAP. EICAR testing was not a clean behavioral validation: Windows blocked the file during a move operation with error 225. That indicates guest antivirus interference, not successful dynamic analysis of EICAR.

8. Known issues and their status

IssueWhat was observedCurrent understanding
Snapshot state confusionSnapshot listing and startup checks disagreed about the powered-on state.Later tasks successfully reverted the configured clean snapshot. The exact corrective snapshot operation was not captured.
No machine matched criteriaEarly tasks logged No machines match selection criteria.Later tasks acquired both configured guests. The specific fix for the initial selection error was not recorded.
PCAP permission deniedAppArmor denied tcpdump creating the capture file.Local profile syntax was corrected and reloaded; direct capture and later Cuckoo PCAP generation succeeded.
Port 8000 already in useThe Django development server was already listening and multiple screen sessions existed.Check listeners/processes before launching a duplicate UI or engine.
Control endpoint / 404Scheduler logged that remote control was not implemented for the vsphere machinery.guacd ran on 127.0.0.1:4822, but installing it did not add vSphere machinery support. Use the vSphere console for interactive access in this setup.
PDF / Office analysisThe Cuckoo PDF package searched for Adobe Reader. Office 2016 setup on Windows 7 failed because Universal CRT update KB2999226 failed to install.Document analysis remained in progress; do not mark it operational until guest apps and analysis packages are tested end to end.

9. Security considerations

Network and firewall isolation evidence for the Cuckoo analysis environment
MAL-SS-10 — network / firewall isolation evidence.

10. Key lessons

11. References

This lab used obsolete dependencies and legacy Cuckoo documentation. Re-check upstream compatibility, maintenance status, security controls, rule licenses, and rule variables before reproducing these steps.

Discuss malware analysis and detection engineering

Working on a sandbox, YARA detection validation, or SOC investigation workflows?

Contact me to discuss Cuckoo-style analysis workflows, vSphere orchestration, rule validation, and detection engineering.