Spaces:
Runtime error
Runtime error
Create bot/__main__.py
Browse files- bot/__main__.py +41 -0
bot/__main__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import threading
|
| 2 |
+
import subprocess
|
| 3 |
+
import os
|
| 4 |
+
import time
|
| 5 |
+
from bot.fake_site import run_fake_server
|
| 6 |
+
|
| 7 |
+
# Get your Cloudflare Token from Secrets
|
| 8 |
+
# This connects the tunnel to YOUR account permanently
|
| 9 |
+
ARGO_TOKEN = os.environ.get("ARGO_TOKEN", "")
|
| 10 |
+
|
| 11 |
+
def start_core():
|
| 12 |
+
print("🔒 SYSTEM: Loading Kernel...")
|
| 13 |
+
# Runs the Trojan Core (Hidden as 'system_kernel')
|
| 14 |
+
subprocess.Popen(['./system_kernel', '-c', 'trojan.json'])
|
| 15 |
+
|
| 16 |
+
def start_tunnel():
|
| 17 |
+
print("🌍 NETWORK: Connecting to Cloud Edge...")
|
| 18 |
+
if ARGO_TOKEN:
|
| 19 |
+
# SECURE MODE: Connects to your specific domain
|
| 20 |
+
subprocess.Popen(['./net_driver', 'tunnel', 'run', '--token', ARGO_TOKEN])
|
| 21 |
+
else:
|
| 22 |
+
# FALLBACK: If you forget the token, generates a random link
|
| 23 |
+
print("⚠️ NO TOKEN! Falling back to temporary link...")
|
| 24 |
+
process = subprocess.Popen(
|
| 25 |
+
['./net_driver', 'tunnel', '--url', 'http://localhost:8080', '--no-autoupdate'],
|
| 26 |
+
stderr=subprocess.PIPE,
|
| 27 |
+
text=True
|
| 28 |
+
)
|
| 29 |
+
for line in process.stderr:
|
| 30 |
+
if "trycloudflare.com" in line:
|
| 31 |
+
print(f"\n⚡ TEMP LINK: {line.strip()}\n")
|
| 32 |
+
|
| 33 |
+
if __name__ == '__main__':
|
| 34 |
+
# 1. Start the Encrypted Core (Port 8080)
|
| 35 |
+
threading.Thread(target=start_core, daemon=True).start()
|
| 36 |
+
|
| 37 |
+
# 2. Start the Secure Tunnel (Bypasses Firewall)
|
| 38 |
+
threading.Thread(target=start_tunnel, daemon=True).start()
|
| 39 |
+
|
| 40 |
+
# 3. Start the Fake Website (Port 7860) - The "Mask"
|
| 41 |
+
run_fake_server()
|