#!/usr/bin/env python3
import requests
import urllib3

urllib3.disable_warnings()

BASE_URL = "https://vulnerability-research-dbfd88d4dab49dc2.chals.uoftctf.org"

# Check what cookies the site sets
response = requests.get(BASE_URL + "/welcome/default/index", verify=False)

print("Cookies from server:")
for cookie in response.cookies:
    print(f"  {cookie.name} = {cookie.value[:50]}...")

print("\nAll Set-Cookie headers:")
if 'Set-Cookie' in response.headers:
    print(f"  {response.headers['Set-Cookie']}")

# Try the examples app
print("\n\nTrying /examples/ endpoint:")
try:
    response2 = requests.get(BASE_URL + "/examples/", verify=False, timeout=5)
    print(f"Status: {response2.status_code}")
    print("Cookies:")
    for cookie in response2.cookies:
        print(f"  {cookie.name} = {cookie.value[:50]}...")
except Exception as e:
    print(f"Error: {e}")
