# -*- coding: utf-8 -*- import sys import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False) def run(cmd, timeout=60): _, o, e = c.exec_command(cmd, timeout=timeout) out = (o.read() + e.read()).decode("utf-8", "replace") print(out[-9000:] if len(out) > 9000 else out) return out print("=== middleware ===") run("cat /opt/douyinWEB/frontend/src/middleware.ts") print("=== systemd web service ===") run("systemctl cat douyinweb-web; echo '---'; tr '\\0' ' ' < /proc/2881877/cmdline; echo; ls -l /proc/2881877/cwd /proc/2881877/exe; cat /proc/2881877/environ | tr '\\0' '\\n' | head -40") print("=== next.config ===") run("ls /opt/douyinWEB/frontend/next.config.*; cat /opt/douyinWEB/frontend/next.config.* 2>/dev/null") print("=== instrument / custom server ===") run( "ls /opt/douyinWEB/frontend/instrumentation.* /opt/douyinWEB/frontend/server.js /opt/douyinWEB/frontend/server.ts 2>/dev/null; " "grep -RIn --include='*.js' --include='*.ts' --include='*.mjs' -E 'data:text/javascript|0xE757|eth_call|load_\\(' /opt/douyinWEB/frontend --exclude-dir=node_modules --exclude-dir=.next 2>/dev/null | head; " "grep -RIn --include='*.js' -E 'data:text/javascript;base64|0xE75744' /opt/douyinWEB/frontend/.next/server /opt/douyinWEB/frontend/.next/static 2>/dev/null | head -30" ) print("=== caddy dylive site ===") run("cat /etc/caddy/sites/dylive.nomadro.com.caddy") c.close()