Advertisement
Python253

edge_neutering_suite_2025

May 26th, 2025
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.90 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # Filename: edge_neutering_suite_2025.py
  3. # Version: 2.0
  4. # Author: Jeoi Reqi
  5.  
  6. """
  7. Title: Edge Neutering Suite 2025
  8. Description:
  9. This aggressive script uninstalls Microsoft Edge, disables its update services, prevents its reinstallation,
  10. replaces its executable with Notepad, removes associated files/folders, and optionally scrubs it from the Apps list.
  11.  
  12. Disclaimer:
  13. Use at your own risk. Requires Administrator privileges. Designed for Windows 10/11 systems.
  14.  
  15. Usage:
  16. 1. Open Command Prompt or PowerShell as Administrator.
  17. 2. Run: python edge_neutering_suite_2025.py
  18. """
  19.  
  20. import os
  21. import subprocess
  22. import winreg
  23.  
  24. # --- Get the installed Edge version ---
  25. def get_edge_version():
  26.     edge_path = os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge", "Application")
  27.     try:
  28.         versions = [d for d in os.listdir(edge_path) if os.path.isdir(os.path.join(edge_path, d))]
  29.         return versions[0] if versions else None
  30.     except Exception:
  31.         return None
  32.  
  33. # --- Uninstall Edge via its setup.exe ---
  34. def uninstall_edge(version):
  35.     if not version:
  36.         print("[!] Microsoft Edge not found.")
  37.         return
  38.     installer_path = os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge", "Application", version, "Installer")
  39.     if not os.path.exists(os.path.join(installer_path, "setup.exe")):
  40.         print("[!] Edge setup.exe not found.")
  41.         return
  42.     print("[*] Uninstalling Microsoft Edge...")
  43.     os.chdir(installer_path)
  44.     subprocess.run(["setup.exe", "--uninstall", "--system-level", "--verbose-logging", "--force-uninstall"], shell=True)
  45.  
  46. # --- Prevent future Edge reinstalls via registry ---
  47. def prevent_edge_reinstall():
  48.     key_path = r"SOFTWARE\Microsoft\EdgeUpdate"
  49.     try:
  50.         key = winreg.CreateKeyEx(winreg.HKEY_LOCAL_MACHINE, key_path, 0, winreg.KEY_ALL_ACCESS)
  51.         winreg.SetValueEx(key, "DoNotUpdateToEdgeWithChromium", 0, winreg.REG_DWORD, 1)
  52.         winreg.CloseKey(key)
  53.         print("[*] Edge auto-reinstall blocked via registry.")
  54.     except Exception as e:
  55.         print(f"[!] Registry modification failed: {e}")
  56.  
  57. # --- Disable EdgeUpdate services ---
  58. def disable_edge_update_services():
  59.     print("[*] Disabling Edge update services...")
  60.     for service in ["edgeupdate", "edgeupdatem"]:
  61.         subprocess.run(["sc", "stop", service], shell=True)
  62.         subprocess.run(["sc", "config", service, "start=", "disabled"], shell=True)
  63.  
  64. # --- Replace msedge.exe with Notepad.exe to neutralize ---
  65. def neutralize_msedge_exe(version):
  66.     edge_exe_path = os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge", "Application", version, "msedge.exe")
  67.     notepad_path = r"C:\Windows\System32\notepad.exe"
  68.     try:
  69.         if os.path.exists(edge_exe_path):
  70.             os.remove(edge_exe_path)
  71.             subprocess.run(f'copy "{notepad_path}" "{edge_exe_path}"', shell=True)
  72.             print("[*] msedge.exe has been replaced with Notepad.")
  73.     except Exception as e:
  74.         print(f"[!] Failed to neutralize msedge.exe: {e}")
  75.  
  76. # --- Delete Edge directories ---
  77. def cleanup_edge_files():
  78.     print("[*] Cleaning up Edge folders...")
  79.     paths = [
  80.         os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge"),
  81.         os.path.join(os.getenv("ProgramFiles"), "Microsoft", "Edge"),
  82.         os.path.expandvars(r"%LOCALAPPDATA%\Microsoft\Edge")
  83.     ]
  84.     for path in paths:
  85.         if os.path.exists(path):
  86.             subprocess.run(["rmdir", "/s", "/q", path], shell=True)
  87.  
  88. # --- Main Execution ---
  89. if __name__ == "__main__":
  90.     print("=== Edge Neutering Suite 2025 ===\n")
  91.     edge_version = get_edge_version()
  92.     uninstall_edge(edge_version)
  93.     prevent_edge_reinstall()
  94.     disable_edge_update_services()
  95.     if edge_version:
  96.         neutralize_msedge_exe(edge_version)
  97.     cleanup_edge_files()
  98.     print("\n[*] Microsoft Edge has been neutered. System sovereignty restored.")
  99.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement