#!/usr/bin/env python3 import paramiko CMDS = [ "systemctl status shellcrash --no-pager 2>/dev/null | head -12", "tail -20 /tmp/ShellCrash/ShellCrash.log 2>/dev/null || tail -20 /var/log/shellcrash.log 2>/dev/null || echo no_log", "grep -E 'mode|proxy|mixed|tun|socks' /tmp/ShellCrash/config.yaml 2>/dev/null | head -20", "curl -sS -m 5 http://127.0.0.1:9090/proxies 2>/dev/null | head -c 500 || echo no_clash_api", "neko_count=$(docker ps 2>/dev/null | grep -c neko || echo 0); echo neko_containers=$neko_count; docker ps --format '{{.Names}} {{.Status}}' 2>/dev/null | grep neko", ] for host, pw in [("10.88.0.4", "4669805"), ("10.88.0.5", "4669805")]: print(f"\n{'='*50}\n{host}\n{'='*50}") c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect(host, username="eric", password=pw, timeout=15) for cmd in CMDS: print(f"\n> {cmd[:70]}") _, o, e = c.exec_command(cmd, timeout=25, get_pty=True) print((o.read() + e.read()).decode()[:1200].encode("ascii", "backslashreplace").decode()) c.close()