| import os |
| import time |
| import json |
| import urllib.request |
|
|
| |
| |
| |
| os.system("apt update -y") |
| os.system("apt install -y openssh-server unzip curl wget") |
|
|
| |
| |
| |
| os.system("echo 'root:123456' | chpasswd") |
|
|
| |
| |
| |
| os.system("sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config") |
| os.system("sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config") |
|
|
| |
| |
| |
| os.system("service ssh restart") |
|
|
| |
| |
| |
| os.system("wget -q -O ngrok.zip https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip") |
| os.system("unzip -o ngrok.zip") |
| os.system("chmod +x ngrok") |
|
|
| |
| |
| |
| NGROK_TOKEN = "3C0LPg1zjf8Ui52LQnfPnD8RYAp_Y8Ps2ghwf2yCNvhL7vit" |
| os.system(f"./ngrok config add-authtoken {NGROK_TOKEN}") |
|
|
| |
| |
| |
| os.system("./ngrok tcp 22 > /dev/null 2>&1 &") |
|
|
| print("β³ Menunggu ngrok... (10 detik)") |
| time.sleep(10) |
|
|
| |
| |
| |
| try: |
| with urllib.request.urlopen("http://127.0.0.1:4040/api/tunnels") as response: |
| data = json.loads(response.read()) |
| public_url = data['tunnels'][0]['public_url'] |
| print("\n==============================") |
| print("π₯ SSH AKTIF π₯") |
| print("Host:", public_url.replace("tcp://", "").split(":")[0]) |
| print("Port:", public_url.split(":")[-1]) |
| print("User: root") |
| print("Pass: 123456") |
| print("==============================\n") |
| except: |
| print("β Gagal ambil URL ngrok") |
|
|
| |
| |
| |
| while True: |
| time.sleep(60) |