Files
metasploit-gs/lib/lab/remote_workstation_controller.rb
T
Jonathan Cran 24d2b48f64 Initial commit of an esx/esxi driver for the lab plugin (thanks to kernelsmith). Also updated documentation in lib/lab/README.
git-svn-id: file:///home/svn/framework3/trunk@13151 4d416f70-5f16-0410-b530-b9f4589650da
2011-07-11 05:52:51 +00:00

23 lines
420 B
Ruby

module Lab
module Controllers
module RemoteWorkstationController
def self.running_list(user, host)
user.gsub!(/(\W)*/, '')
host.gsub!(/(\W)*/, '')
remote_cmd = "ssh #{user}@#{host} \"vmrun list nogui\""
vm_list = `#{remote_cmd}`.split("\n")
vm_list.shift
return vm_list
end
def self.dir_list(basepath=nil)
vm_list = Find.find(basepath).select { |f| f =~ /\.vmx$/ }
return vm_list
end
end
end
end