#!/usr/bin/env python3
"""
Quick test to verify remote server connectivity
"""

import requests

BASE_URL = "https://unrealistic-1-7e47fbb90382563c.chals.uoftctf.org"

print("[*] Testing connection to remote server...")
print(f"[*] URL: {BASE_URL}")

try:
    resp = requests.get(BASE_URL, timeout=10)
    print(f"[+] Server is UP! Status: {resp.status_code}")
    print(f"[*] Response preview: {resp.text[:200]}...")
    
    # Test registration endpoint
    print("\n[*] Testing /register endpoint...")
    resp2 = requests.get(f"{BASE_URL}/register", timeout=10)
    print(f"[+] /register accessible! Status: {resp2.status_code}")
    
    # Test bot endpoint
    print("\n[*] Testing /bot endpoint...")
    resp3 = requests.get(f"{BASE_URL}/bot", timeout=10)
    print(f"[+] /bot accessible! Status: {resp3.status_code}")
    
    print("\n[✓] All endpoints accessible! Ready to exploit.")
    print("\n[*] Next step: Run exploit_remote.py")
    
except requests.exceptions.Timeout:
    print("[-] Timeout connecting to server")
except requests.exceptions.ConnectionError:
    print("[-] Connection error - server might be down")
except Exception as e:
    print(f"[-] Error: {e}")
