Files
exposedgays/deploy/try-route-dns.py

24 lines
990 B
Python

#!/usr/bin/env python3
import paramiko
PASS = "Bbt9115xty9176!"
TUNNEL = "03079a26-f14c-4622-b463-ba54a24f7472"
CREDS = f"/etc/cloudflared/{TUNNEL}.json"
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("10.10.0.10", username="localadministrator", password=PASS, timeout=30)
cmds = [
f"echo '{PASS}' | sudo -S cloudflared tunnel --cred-file {CREDS} route dns --help 2>&1 | head -25",
f"echo '{PASS}' | sudo -S cloudflared tunnel --cred-file {CREDS} route dns {TUNNEL} www.exposedgays.com 2>&1",
f"echo '{PASS}' | sudo -S cloudflared tunnel --cred-file {CREDS} route dns {TUNNEL} exposedgays.com 2>&1",
"dig @1.1.1.1 www.exposedgays.com CNAME +short",
"curl -sSI --max-time 15 https://www.exposedgays.com/ | head -10",
]
for cmd in cmds:
print(f"\n=== {cmd[:90]} ===")
_, o, e = c.exec_command(cmd, timeout=60)
o.channel.recv_exit_status()
print((o.read() + e.read()).decode(errors="replace")[:3000])
c.close()