Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # Filename: edge_neuter_cleanup.py
- # Version: 1.1
- # Author: Jeoi Reqi
- # Description: Follow-up cleanup & verification script for the Edge Neutering Suite 2025.
- import os
- import shutil
- import subprocess
- import time
- EDGE_DIRS = [
- os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge"),
- os.path.join(os.getenv("ProgramFiles"), "Microsoft", "Edge"),
- os.path.join(os.getenv("LocalAppData"), "Microsoft", "Edge")
- ]
- MSEDGE_PATH = os.path.join(os.getenv("ProgramFiles(x86)"), "Microsoft", "Edge", "Application", "msedge.exe")
- NOTEPAD_PATH = os.path.join(os.getenv("SystemRoot"), "System32", "notepad.exe")
- def cleanup_edge_files():
- print("[*] Attempting deep cleanup of Edge folders...")
- for path in EDGE_DIRS:
- if os.path.exists(path):
- try:
- shutil.rmtree(path)
- print(f"[+] Deleted: {path}")
- except Exception as e:
- print(f"[!] Could not delete: {path} — {e}")
- else:
- print(f"[-] Not found: {path}")
- print("[*] Cleanup completed.")
- def verify_neutering():
- print("[*] Verifying Edge neutering status...")
- # Check if msedge.exe points to Notepad
- if os.path.exists(MSEDGE_PATH):
- try:
- edge_stat = os.stat(MSEDGE_PATH)
- note_stat = os.stat(NOTEPAD_PATH)
- if edge_stat.st_ino == note_stat.st_ino or edge_stat.st_size == note_stat.st_size:
- print("[+] msedge.exe is neutered (Notepad).")
- else:
- print("[!] msedge.exe is NOT Notepad. Replacing...")
- replace_with_notepad()
- except Exception as e:
- print(f"[!] Error verifying msedge.exe: {e}")
- else:
- print("[-] msedge.exe not found. Likely removed.")
- def replace_with_notepad():
- try:
- if os.path.exists(MSEDGE_PATH):
- os.remove(MSEDGE_PATH)
- shutil.copyfile(NOTEPAD_PATH, MSEDGE_PATH)
- print("[+] Replaced msedge.exe with Notepad.")
- except Exception as e:
- print(f"[!] Failed to replace msedge.exe: {e}")
- if __name__ == "__main__":
- print("\n=== Edge Neutering Suite 2025 — Post-Reboot Cleanup Mode ===\n")
- cleanup_edge_files()
- time.sleep(1)
- verify_neutering()
- print("\n[*] Post-reboot cleanup completed.\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement