programming/sillygoose
267 points
Writeup by Aryan
import socket
def binary_search(low, high):
while low <= high:
mid = (low + high) // 2
guess = str(mid)
print(f"Trying {guess}")
s.send((guess + '\n').encode())
response = s.recv(1024).decode().strip()
if "congratulations" in response:
return "Flag below!\n" + response
elif "too large" in response:
high = mid - 1
elif "too small" in response:
low = mid + 1
elif "time" in response or "skill issue" in response:
return response
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('24.199.110.35', 41199))
print(binary_search(0, 10**100))
s.close()Last updated