Stop Drop and Roll
Challenge
Explications
Script de résolution
from pwnlib.tubes.remote import remote
CONVERSION = {'GORGE': 'STOP', 'PHREAK': 'DROP', 'FIRE': 'ROLL'}
def answer_question(raw: bytes) -> bytes:
words = raw.decode().splitlines()[-2].split(', ')
return '-'.join([CONVERSION[word] for word in words]).encode()
def solve(host, port):
client = remote(host, port)
client.recvuntil(b'Are you ready? (y/n) ')
client.sendline(b'y')
for i in range(500):
data = client.recvuntil(b'What do you do? ', timeout=1)
answer = answer_question(data)
client.sendline(answer)
flag = client.recvall(timeout=1).decode().split('flag is ')[1].strip()
print(f'Flag: {flag}')
if __name__ == '__main__':
solve('83.136.252.82', 38440)Mis à jour