49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""READ-ONLY: Extensions dirs + google cookies count for physical assign neko."""
|
|
from __future__ import annotations
|
|
|
|
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",
|
|
4014,
|
|
"eric",
|
|
"4669805",
|
|
timeout=45,
|
|
allow_agent=False,
|
|
look_for_keys=False,
|
|
banner_timeout=120,
|
|
)
|
|
cmd = r"""
|
|
echo '4669805' | sudo -S -p '' bash -lc '
|
|
set +e
|
|
P=/opt/douyinWEB/backend/data/neko/profiles
|
|
TM=dhdgffkkebhmkfjojejmpbldmpobfkfo
|
|
for id in 1 2 3 4 5 6 7 8; do
|
|
echo "======== profile $id ========"
|
|
echo -n "Extensions: "; ls "$P/$id/Default/Extensions" 2>/dev/null | tr "\n" " "; echo
|
|
echo -n "TM dir: "; ls -d "$P/$id/Default/Extensions/$TM" 2>/dev/null || echo MISSING
|
|
echo -n "LiveOps ext: "; ls "$P/$id/Default/Extensions" 2>/dev/null | head -5
|
|
# sqlite cookie hosts if possible
|
|
if command -v sqlite3 >/dev/null; then
|
|
sqlite3 "$P/$id/Default/Cookies" "select host_key,name from cookies where host_key like \"%google%\" or host_key like \"%youtube%\" limit 8;" 2>/dev/null | head
|
|
echo -n "cookie_rows="; sqlite3 "$P/$id/Default/Cookies" "select count(*) from cookies;" 2>/dev/null; echo
|
|
else
|
|
echo "no sqlite3"
|
|
# file size already known
|
|
fi
|
|
done
|
|
echo "--- who listens physical 9200 ---"
|
|
ss -lntp | grep -E ":920[0-7]\b" | head
|
|
curl -sS -m 3 -o /dev/null -w "local9200=%{http_code}\n" http://127.0.0.1:9200/
|
|
'
|
|
"""
|
|
_i, o, e = c.exec_command(cmd, timeout=90)
|
|
print((o.read() + e.read()).decode("utf-8", "replace"))
|
|
c.close()
|