Skip to content

Instantly share code, notes, and snippets.

@JasonTurley
Created February 15, 2021 23:04
Show Gist options
  • Save JasonTurley/3cbd1685490a3563f120fbf5cf64f3bf to your computer and use it in GitHub Desktop.
Save JasonTurley/3cbd1685490a3563f120fbf5cf64f3bf to your computer and use it in GitHub Desktop.
My solution to the TryHackMe Advent of Cyber Day 16 challenge
import requests
machine_ip = "10.10.83.105"
host = f"http://{machine_ip}/api/"
# Only attempt odd keys
for key in range(100):
if key % 2 != 0:
response = requests.get(host + str(key))
# Only print the correct api key
if "Error. Key not valid!" not in response.text:
print(f"The correct api key is {key}"
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment