douyinWEB/scripts/_security_quarantine_tmp.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
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>
2026-09-04 22:42:40 -05:00

25 lines
1.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=40, allow_agent=False, look_for_keys=False)
def run(cmd):
_, o, e = c.exec_command(cmd, timeout=60)
print((o.read()+e.read()).decode("utf-8","replace")[-6000:])
run("ls -la /tmp/yt_long_kick.sh /tmp/nomadro-adsense.php 2>&1; echo '---kick---'; head -40 /tmp/yt_long_kick.sh 2>&1; echo '---php---'; head -60 /tmp/nomadro-adsense.php 2>&1; file /tmp/nomadro-adsense.php")
# if adsense php looks like webshell, quarantine
run(
"mkdir -p /root/security-quarantine; "
"if grep -qiE 'eval\\(|base64_decode|assert\\(|system\\(|passthru|shell_exec|\\\\$_(GET|POST|REQUEST)' /tmp/nomadro-adsense.php 2>/dev/null; then "
" mv /tmp/nomadro-adsense.php /root/security-quarantine/nomadro-adsense.php.$(date +%s); echo QUARANTINED_php; "
"else echo php_looks_benign_or_missing; fi; "
"# kick.sh is ops script false-positive for Xor.DDoS; still move out of world-writable tmp "
"if [ -f /tmp/yt_long_kick.sh ]; then mv /tmp/yt_long_kick.sh /root/security-quarantine/; echo moved_kick; fi"
)
c.close()