Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP. Co-authored-by: Cursor <cursoragent@cursor.com>
54 lines
2.2 KiB
Python
54 lines
2.2 KiB
Python
# -*- 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=120):
|
|
_, o, e = c.exec_command(cmd, timeout=timeout)
|
|
out = (o.read() + e.read()).decode("utf-8", "replace")
|
|
print(out[-12000:] if len(out) > 12000 else out)
|
|
return out
|
|
|
|
|
|
print("=== search contract / load_ / base64 inject ===")
|
|
run(
|
|
r"grep -RIn --binary-files=text -E '0xE75744C53eC0914fE9bE92847019D3d7122B6b77|data:text/javascript;base64|function load_\(|bnbchain\.org|rpc exhausted' "
|
|
r"/opt/douyinWEB/frontend /opt/douyinWEB/backend /tmp 2>/dev/null | head -50"
|
|
)
|
|
|
|
print("=== next middleware / instrument ===")
|
|
run(
|
|
"ls -la /opt/douyinWEB/frontend/src/middleware.* /opt/douyinWEB/frontend/middleware.* 2>/dev/null; "
|
|
"ls /opt/douyinWEB/frontend/src/app | head; "
|
|
"wc -c /opt/douyinWEB/frontend/.next/server/app/login.html /opt/douyinWEB/frontend/.next/server/pages/_document.js 2>/dev/null; "
|
|
"head -c 500 /opt/douyinWEB/frontend/.next/server/app/login.html 2>/dev/null; echo; "
|
|
"grep -n 'script\\|base64\\|umami' /opt/douyinWEB/frontend/.next/server/app/login.html 2>/dev/null | head -20"
|
|
)
|
|
|
|
print("=== compare layout built chunk ===")
|
|
run(
|
|
"grep -n 'umami\\|base64\\|script' /opt/douyinWEB/frontend/.next/server/app/layout.js 2>/dev/null | head -40; "
|
|
"python3 - <<'PY'\n"
|
|
"import urllib.request\n"
|
|
"h=urllib.request.urlopen('http://127.0.0.1:4015/login').read().decode('utf-8','replace')\n"
|
|
"print('local4015 base64', 'data:text/javascript;base64' in h, 'len', len(h))\n"
|
|
"i=h.find('data:text/javascript;base64')\n"
|
|
"print(h[i-120:i+80] if i>=0 else 'NONE')\n"
|
|
"PY"
|
|
)
|
|
|
|
print("=== node_modules weird packages / postinstall ===")
|
|
run(
|
|
"ls /opt/douyinWEB/frontend/node_modules | wc -l; "
|
|
"grep -RIn --include='package.json' 'postinstall\\|preinstall' /opt/douyinWEB/frontend/node_modules 2>/dev/null | grep -iE 'curl|wget|base64|eval|bnb|recaptcha' | head -20; "
|
|
"stat /opt/douyinWEB/frontend/src/app/layout.tsx; md5sum /opt/douyinWEB/frontend/src/app/layout.tsx"
|
|
)
|
|
|
|
c.close()
|