Files
felhom.eu/documentation/audits/fixes-2026-10-21/tools/resend_curl.sh
T

13 lines
679 B
Bash
Executable File

#!/bin/bash
# resend_curl.sh TOKEN_ENV — the spent bind link's „Új linket kérek" press, endpoint-level (the form POST). Prints the
# answer page's visible text only; the token never reaches a command line or the output.
set -euo pipefail
T=$(mktemp -d); chmod 700 "$T"; trap 'rm -rf "$T"' EXIT
printf 'url = "https://hub.felhom.eu/bind/%s/resend"\n' "${!1}" > "$T/cfg"
curl -s -K "$T/cfg" -X POST -o "$T/p" -w "POST %{http_code}\n"
python3 - "$T/p" <<'PY'
import re,sys,html
t=open(sys.argv[1],encoding="utf-8").read(); t=re.sub(r"<(script|style)[^>]*>.*?</\1>","",t,flags=re.S)
print("answer:", re.sub(r"\s+"," ",html.unescape(re.sub(r"<[^>]+>"," ",t))).strip()[:500])
PY