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

Function profiler_export

Scripts/ButSystem.py:15952–16057  ·  view source on GitHub ↗

profiler_export. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.

()

Source from the content-addressed store, hash-verified

15950
15951 mime = row["mime"] or "audio/webm"
15952 try:
15953 if is_encrypted_file(sp):
15954 gen = aesgcm_decrypt_generator(sp)
15955 resp = Response(gen, mimetype=mime)
15956 else:
15957 from flask import send_file
15958 resp = send_file(sp, mimetype=mime, as_attachment=False, conditional=True, max_age=0)
15959 except Exception:
15960 abort(404)
15961
15962 resp.headers["Cache-Control"] = "no-store"
15963 return resp
15964
15965
15966# ----------
15967# -----------------
15968# Profiler (text encrypted; attachments plaintext)
15969# ---------------------------
15970
15971
15972# ---------------- Profiler optional fields helpers ----------------
15973
15974PROFILER_OPTIONAL_KEYS = [
15975 "phone", "email", "car_model", "license_plate", "id_number",
15976 "height_cm", "weight_kg", "eye_color", "hair_color", "job",
15977 "country", "state", "town", "address", "family_members", "close_friends" ]
15978
15979def profiler_collect_optional(form) -> Dict[str, str]:
15980 """profiler_collect_optional.
15981
15982Internal helper function.
15983
15984This docstring was added automatically to improve maintainability.
15985
15986Args:
15987 form: Parameter.
15988
15989Returns:
15990 Varies.
15991"""
15992 def clean(s: str) -> str:
15993 """clean.
15994
15995Internal helper function.
15996
15997This docstring was added automatically to improve maintainability.
15998
15999Args:
16000 s: Parameter.
16001
16002Returns:
16003 Varies.
16004"""
16005 return (s or "").strip()
16006
16007 out: Dict[str, str] = {}
16008 out["phone"] = clean(form.get("opt_phone"))
16009 out["email"] = clean(form.get("opt_email"))

Callers

nothing calls this directly

Calls 9

current_userFunction · 0.70
db_connectFunction · 0.70
aesgcm_decrypt_textFunction · 0.70
is_encrypted_fileFunction · 0.70
aesgcm_decrypt_generatorFunction · 0.70
now_zFunction · 0.70
downloads_dirFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected