Ship zombie reconcile, S3 covers, session end/drill-down, rooms ops, and refresh README for production. Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.5 KiB
Python
51 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
import paramiko
|
|
|
|
host = "107.173.30.245"
|
|
combos = [
|
|
("root", "Xiao4669805", 4014),
|
|
("root", "Xiao4669805", 22),
|
|
("root", "4669805", 4014),
|
|
("root", "4669805", 22),
|
|
("eric", "4669805", 4014),
|
|
("eric", "Xiao4669805", 4014),
|
|
("eric", "4669805", 22),
|
|
("root", "Xiao4669805", 4014, True),
|
|
]
|
|
|
|
for item in combos:
|
|
user, pwd, port = item[0], item[1], item[2]
|
|
use_ki = len(item) > 3 and item[3]
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
try:
|
|
if use_ki:
|
|
# keyboard-interactive
|
|
transport = paramiko.Transport((host, port))
|
|
transport.connect()
|
|
def handler(title, instructions, prompt_list):
|
|
return [pwd for _ in prompt_list]
|
|
transport.auth_interactive(user, handler)
|
|
print("OK-KI", user, port)
|
|
sess = transport.open_session()
|
|
sess.exec_command("whoami; hostname")
|
|
print(sess.recv(4096).decode())
|
|
transport.close()
|
|
break
|
|
c.connect(
|
|
host,
|
|
port=port,
|
|
username=user,
|
|
password=pwd,
|
|
timeout=20,
|
|
allow_agent=False,
|
|
look_for_keys=False,
|
|
banner_timeout=20,
|
|
)
|
|
_, o, _ = c.exec_command("whoami; hostname", timeout=20)
|
|
print("OK", user, port, o.read().decode().strip())
|
|
c.close()
|
|
break
|
|
except Exception as e:
|
|
print("FAIL", user, port, "KI" if use_ki else "PW", type(e).__name__, e)
|