1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import win32security, win32con, win32api
import subprocess
login = 'administrateur'
domain = '.'
password = 'bibi'
handle = win32security.LogonUser(login, domain, password, win32con.LOGON32_LOGON_INTERACTIVE, win32con.LOGON32_PROVIDER_DEFAULT)
win32security.ImpersonateLoggedOnUser(handle)
filePath = r"C:\Windows\System32\notepad.exe"
subprocess.Popen(filePath, close_fds=True)
win32security.RevertToSelf()
handle.Close()
sys.exit() |
Partager