user2566898
user2566898

Reputation: 1717

automatic VMware snaphots creation

I need to run different Malware samples on Vmware and record the network traffic for each sample.

For each run I need to ensure that the image is clean,so I will use snapshot for the original image, execute the sample, record the network traffic and finally restore to the clean snapshot.

The thing is I have large number of samples (more than a thousand). So is there any way to automate the process? It would be great if you help me in where to start scripting.

Upvotes: 2

Views: 155

Answers (1)

Mikhail Shcherbakov
Mikhail Shcherbakov

Reputation: 1826

You could use any scripting API: vSphere SDK for Python, vSphere SDK for Perl, PowerShell interface for managing vSphere, vmrun command-line utility. Or VMware vSphere Web Services SDK using SOAP. All of them support operations with snapshots. For example, the following script uses the vmrun utility to create a snapshot and rollback to it:

vmrun -T vc -h 10.1.1.44 -u root -p vmware snapshot "[datacenter-2/datastore1] CENTER/CENTER.vmx" CleanSnapshot
vmrun -T vc -h 10.1.1.44 -u root -p vmware -gu Administrator -gp P@ssword runScriptInGuest "[datacenter-2/datastore1] CENTER/CENTER.vmx" "" "echo Test > c:\test.txt"
vmrun -T vc -h 10.1.1.44 -u root -p vmware revertToSnapshot "[datacenter-2/datastore1] CENTER/CENTER.vmx" CleanSnapshot

Upvotes: 2

Related Questions