This script is a modified version of RunAsSystem.py originally created by joren485.
It is a Windows privilege escalator that duplicates a SYSTEM token from winlogon.exe and launches a process with system elevated rights.
- Run the script as Administrator (required).
- It will attempt to find
winlogon.exerunning as SYSTEM. - If successful, it launches a SYSTEM command prompt:
python privileges.pyIf successful, you should see:
[*] Found system IL process winlogon.exe with PID: 888
[+] Grabbing token
[*] Impersonating System IL token
[*] Triggering payload PID: 1234
- Windows system (this is only tested on w11 22h2).
- Python 3.x with no extra dependencies (only uses
ctypes, part of the standard library). - Must be executed from an elevated Administrator command prompt.