Files
felhom.eu/documentation/audits/signup-lock-2026-09-29/B/wtr2.sh
T

9 lines
831 B
Bash

DB=hike-db.enkisfelhom.hu; n=0
t() { n=$((n+1)); c=$(curl -sk -o /tmp/t.b -w '%{http_code}' -H "Host: $DB" -H 'Content-Type: application/json' -X POST -d "$2" "https://127.0.0.1$1"); v=$(grep -q 'sign-up is closed' /tmp/t.b && echo BLOCK || (grep -q '"collectionName":"users"\|"collectionId":"_pb_users_auth_"' /tmp/t.b && echo GOT-IN || echo APP-REFUSED)); printf '%-50s -> %s %s %s\n' "$1" "$c" "$v" "$(head -c 70 /tmp/t.b)"; }
U() { echo "{\"username\":\"trk$1$$\",\"email\":\"trk$1$$@x.hu\",\"password\":\"Xx12345678z9\",\"passwordConfirm\":\"Xx12345678z9\"}"; }
t /api/collections/USERS/records "$(U a)"
t /api/collections/Users/records "$(U b)"
t /api/collections/_PB_USERS_AUTH_/records "$(U c)"
t /api/batch "{\"requests\":[{\"method\":\"POST\",\"url\":\"/api/collections/users/records\",\"body\":$(U d)}]}"
rm -f /tmp/t.b