21 lines
804 B
Python
21 lines
804 B
Python
#!/usr/bin/env python3
|
|
import paramiko
|
|
|
|
PASS = "Bbt9115xty9176!"
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("10.10.0.1", username="admin", password=PASS, timeout=15)
|
|
_, o, e = c.exec_command("cat /usr/local/etc/wan-dns-failover.env", timeout=30)
|
|
o.channel.recv_exit_status()
|
|
text = (o.read() + e.read()).decode()
|
|
c.close()
|
|
for line in text.splitlines():
|
|
if any(k in line.upper() for k in ["CLOUDFLARE", "CF_", "TUNNEL", "AUTH"]):
|
|
if "SECRET" in line.upper() or "TOKEN" in line.upper() or "KEY" in line.upper() or "EMAIL" in line.upper():
|
|
k, _, v = line.partition("=")
|
|
v = v.strip()
|
|
if len(v) > 12:
|
|
v = v[:8] + "..." + v[-4:]
|
|
print(f"{k}={v}")
|
|
else:
|
|
print(line) |