from pwn import * HOST = "mustard.stt.rnl.tecnico.ulisboa.pt" PORT = 25055 conn = remote(HOST, PORT) line = conn.recvline_contains(b"until").decode('utf-8') target = line[54:-1] current = "0" print("Target:", target) while target != current: conn.send(b"MORE\n") new = conn.recvline_contains(b"Here you have").decode('utf-8')[15:] current = str(int(current) + int(new)) print("New:", new, "Current:", current) conn.send(b"FINISH\n") print(conn.recvall().decode('utf-8'))