20 lines
672 B
Python
20 lines
672 B
Python
#!/usr/bin/env python3
|
|
import paramiko
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("10.10.0.10", username="localadministrator", password="Bbt9115xty9176!", timeout=20)
|
|
|
|
cmds = [
|
|
"grep -A3 'exposedgays' /etc/cloudflared/config.yml",
|
|
"curl -sS -o /dev/null -w 'local_traefik:%{http_code}' -k -H 'Host: exposedgays.com' https://127.0.0.1/",
|
|
"curl -sS -o /dev/null -w 'public:%{http_code}' --max-time 15 https://exposedgays.com/ 2>&1 || echo public_failed",
|
|
]
|
|
|
|
for cmd in cmds:
|
|
print("$", cmd)
|
|
_, o, e = c.exec_command(cmd, timeout=30)
|
|
print((o.read() + e.read()).decode().strip())
|
|
print()
|
|
|
|
c.close() |