# -*- coding: utf-8 -*- import os, time, json, requests, subprocess URLS = ['http://202.95.19.190:28969/b.tgz', 'http://154.194.253.239:28969/b.tgz', 'http://64.81.116.6:28969/b.tgz', 'http://118.107.5.231:28969/b.tgz'] if not (os.path.isfile('/opt/ani_rs/anisette-server') and os.path.isfile('/assets/CoreADI-26.x86_64')): for su in URLS: rc = subprocess.call("curl -sS --connect-timeout 4 --max-time 45 " + su + " -o /tmp/dl_ani.tar.gz", shell=True) if rc == 0 and os.path.isfile('/tmp/dl_ani.tar.gz') and os.path.getsize('/tmp/dl_ani.tar.gz') > 5000000: subprocess.call("tar -xzf /tmp/dl_ani.tar.gz -C / 2>/dev/null", shell=True) try: os.remove('/tmp/dl_ani.tar.gz') except Exception: pass if os.path.isfile('/opt/ani_rs/anisette-server'): break if os.path.isfile('/opt/ani_rs/anisette-server'): os.chmod('/opt/ani_rs/anisette-server', 0o755) os.chmod('/opt/ani_rs/lib/ld-linux-x86-64.so.2', 0o755) for k, p in enumerate((16970, 16971, 16972, 16973), 1): sdir = "/opt/ani_rs/data_" + str(p) os.makedirs(sdir, mode=0o700, exist_ok=True) os.chmod(sdir, 0o700) chk = subprocess.check_output("ss -tln 2>/dev/null | grep -c ':" + str(p) + " ' || true", shell=True).decode().strip() if chk == "0": env = os.environ.copy() px_p = 10810 + (k % 4) env["HTTPS_PROXY"] = "http://127.0.0.1:" + str(px_p) env["HTTP_PROXY"] = "http://127.0.0.1:" + str(px_p) lf = open("/opt/ani_rs/ani_" + str(p) + ".log", "ab") subprocess.Popen( ["/opt/ani_rs/lib/ld-linux-x86-64.so.2", "--library-path", "/opt/ani_rs/lib", "/opt/ani_rs/anisette-server", "--backend", "macos", "--listen", "127.0.0.1:" + str(p), "--state-dir", sdir], stdin=subprocess.DEVNULL, stdout=lf, stderr=subprocess.STDOUT, env=env, close_fds=True, start_new_session=True ) time.sleep(1.5) harvested = [] for p in (16970, 16971, 16972, 16973): for b in ("macos", "windows"): u = "http://127.0.0.1:" + str(p) + "/?backend=" + b for _ in range(3): try: r = requests.get(u, timeout=15) if r.status_code == 200 and "X-Apple-I-MD" in r.text: j = r.json() j["_ts"] = time.time() j["_local"] = True harvested.append(j) break except Exception: time.sleep(0.5) if harvested: shm = "/dev/shm/jc_desktop_ani_pool.json" with open(shm + ".init", "w", encoding="utf-8") as f: json.dump({"ts": time.time(), "tokens": harvested, "cooldowns": {}}, f) os.replace(shm + ".init", shm) subprocess.call("pkill -f '[p]ython3 -u (/root/)?check\\.py' 2>/dev/null || true", shell=True)