import requests
def submit_flag(flag):
url = f"{CRUCIBLE_URL}/api/challenges/{CHALLENGE}/submit-flag"
headers = {"X-API-Key": DREADNODE_API_KEY}
payload = {"challenge": CHALLENGE, "flag": flag}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
if response.json().get("correct") is True:
print("The flag was correct. Congrats!")
else:
print("The flag was incorrect. Keep trying!")
else:
print("There was an error submitting your flag")
print(response.text)
flag = "gAAAAABnJreQ5YYJ9x9m4oFdFMXUsbmH0_FmG5trWTGzVXI-TIvB9APjquiIdv8HJzRWP56Qkm1L3ef8qXf5J6Q0s3D_-d21N2r_FMjlTbtYdXwLl4IM5wD60ut5kstqsD4k0NgNzJqxVJb7Llm1QrIAHXkL54jxgcmORWlNw9t-fKvTxoQGy0g=" # Replace with the flag once you find it
submit_flag(flag)