# -*- coding: utf-8 -*- import sys, paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") REMOTE = r''' set +e TOKEN=$(curl -sS -X POST 'http://127.0.0.1:9000/api/v1/auth/login' \ -H 'Content-Type: application/json' \ -d '{"username":"hackrobot","password":"Xiao4669805@"}' | python3 -c "import sys,json; print(json.load(sys.stdin)['body']['token'])") python3 < http={code} t={dt:.2f}s msg={msg} body_keys={list(body)[:12] if isinstance(body,dict) else type(body).__name__}") if isinstance(d,dict) and d.get("code")==200: s=json.dumps(d,ensure_ascii=False)[:1200] print(" ", s) # list proxies then try status with ids code,d,dt = call("POST","/api/v1/proxy/list",{"page":1,"page_size":50}) print("\nproxy list", d.get("code"), d.get("msg"), f"t={dt:.2f}") proxies=[] if isinstance(d.get("body"), dict): proxies = d["body"].get("proxies") or d["body"].get("list") or [] print("count", len(proxies)) for p in proxies: if isinstance(p, dict): print({k:p.get(k) for k in ["id","name","type","client_id","server_id","stopped","status","working_status","state"] if k in p or True}) # print compact print(" ", {k:p.get(k) for k in list(p)[:15]}) # try clientsstatus with real ids from client list code,cl,dt=call("POST","/api/v1/client/list",{"page":1,"page_size":50}) clients=(cl.get("body") or {}).get("clients") or [] ids=[] for c in clients: ids.append(c.get("id")) ids.extend(c.get("client_ids") or []) print("\nclient ids", ids) for body in [ {"client_ids": ids}, {"clientIds": ids}, {"ids": ids}, {"ClientIds": ids}, ]: code,d,dt=call("POST","/api/v1/platform/clientsstatus", body) print("clientsstatus", body.keys(), "->", d.get("code"), d.get("msg"), f"t={dt:.2f}", str(d.get("body"))[:400]) PY echo echo '=== recent logs mentioning proxy/status/vps ===' docker logs --since 2h frp-panel 2>&1 | grep -iE 'error|warn|timeout|vps|proxy|status|rpc' | tail -50 echo echo '=== reachability to hackrobot.s.vps 107.173.30.245 ===' timeout 5 bash -c 'echo >/dev/tcp/107.173.30.245/7000' && echo '7000 open' || echo '7000 fail' timeout 5 bash -c 'echo >/dev/tcp/107.173.30.245/9001' && echo '9001 open' || echo '9001 fail' timeout 5 bash -c 'echo >/dev/tcp/107.173.30.245/22' && echo '22 open' || echo '22 fail' curl -sS -o /dev/null -w 'http9000:%{http_code} t=%{time_total}\n' --max-time 8 http://107.173.30.245:9000/ || echo http9000 fail ''' c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect('107.172.77.34',22,'root','Xiao4669805',timeout=45,allow_agent=False,look_for_keys=False) _,o,e=c.exec_command(REMOTE,timeout=180) print(o.read().decode('utf-8','replace')) err=e.read().decode('utf-8','replace') if err.strip(): print('STDERR', err[-1500:]) c.close()