MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / start_cloudflared

Function start_cloudflared

Scripts/ButSystem.py:16871–16906  ·  view source on GitHub ↗

Start a Cloudflare quick tunnel (best-effort) and set CLOUDFLARED_URL. Uses the more robust output-parsing logic from Connections.py.

(port: int)

Source from the content-addressed store, hash-verified

16869 "attachments": []
16870 }
16871
16872 for a in atts_by_entry.get(r["id"], []):
16873 try:
16874 fn = aesgcm_decrypt_text(a["filename_enc"])
16875 mime = aesgcm_decrypt_text(a["mime_enc"])
16876 except Exception:
16877 fn, mime = "file", "application/octet-stream"
16878 rel = f"{r['id']}/{fn}"
16879 item["attachments"].append({"filename": fn, "mime": mime, "path": rel})
16880
16881 # Decrypt attachment into temp folder so it can be zipped
16882 src = a["stored_path"]
16883 dst = os.path.join(att_out_root, rel)
16884 os.makedirs(os.path.dirname(dst), exist_ok=True)
16885 try:
16886 if is_encrypted_file(src):
16887 with open(dst, "wb") as out:
16888 for chunk in aesgcm_decrypt_generator(src):
16889 out.write(chunk)
16890 else:
16891 shutil.copy2(src, dst)
16892 except Exception:
16893 pass
16894
16895 export.append(item)
16896
16897 with open(os.path.join(tmp_dir, "profiles.json"), "w", encoding="utf-8") as f:
16898 json.dump({"owner": owner, "exported_at": now_z(), "profiles": export}, f, ensure_ascii=False, indent=2)
16899
16900 out_dir = downloads_dir()
16901 os.makedirs(out_dir, exist_ok=True)
16902 out_zip = os.path.join(out_dir, "Profiler.zip")
16903
16904 # If exists, write a new numbered zip like Profiler-1.zip etc.
16905 if os.path.exists(out_zip):
16906 n = 1
16907 while True:
16908 cand = os.path.join(out_dir, f"Profiler-{n}.zip")
16909 if not os.path.exists(cand):

Callers

nothing calls this directly

Calls 3

have_cmdFunction · 0.70
_is_termuxFunction · 0.70
termux_pkg_installFunction · 0.70

Tested by

no test coverage detected