githubEdit

User Account Control

User Account Control(UAC): feature in windows which display consent prompt when program run service need high privilege

عباره عن برومبت بتظهر لما بترن حاجه محتاجه صلاحيات عاليه

When UAC is enable all Apps running with user privilege wither admin accept to running with admin privilege

لما الحاجه دي تبقي شغاله البرامج والمهام بتشتغل بصلاحيات مستخدم عادي، إلا لو الأدمن وافق صراحة إنها تشتغل بصلاحيات أدمن. ده بيحمي الأدمن من إنه يعمل تغييرات خطيرة من غير قصد.

UAC is not Security Boundary


Checking Current User

C:\htb> whoami /user

USER INFORMATION
----------------

User Name         SID
================= ==============================================
winlpe-ws03\sarah S-1-5-21-3159276091-2191180989-3781274054-1002

Confirming Admin Group Membership

C:\htb> net localgroup administrators

Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
Administrator
mrb3n
sarah
The command completed successfully.

Reviewing User Privileges

Confirming UAC is Enabled

check if UAC is enabled if value is 0x1 then UAC is enabled

Checking UAC Level

The value of ConsentPromptBehaviorAdmin is 0x5, which means the highest UAC level of Always notify is enabled. There are fewer UAC bypasses at this highest level.

Checking Windows Version

UAC bypasses leverage flaws or unintended functionality in different Windows builds

This returns the build version 14393, which using thisarrow-up-right page we cross-reference to Windows release 1607.

image.png

The UACMEarrow-up-right project maintains a list of UAC bypasses, including information on the affected Windows build number, the technique used, and if Microsoft has issued a security update to fix it

Reviewing Path Variable

The WindowsApps folder is within the user's profile and writable by the user.

We can potentially bypass UAC in this by using DLL hijacking by placing a malicious srrstr.dll DLL to WindowsApps folder, which will be loaded in an elevated context.


Generating Malicious srrstr.dll DLL

First, let's generate a DLL to execute a reverse shell. and open listener

Testing Connection

run dll with privilege user to confirm it’s work

Executing SystemPropertiesAdvanced.exe on Target Host

Before proceeding, we should ensure that any instances of the rundll32 process from our previous execution have been terminated.

Now, we can try the 32-bit version of SystemPropertiesAdvanced.exe from the target host.

Receiving Connection Back

Checking back on our listener, we should receive a connection almost instantly.


Last updated