Level 2 - Leaky Matrices
Last updated
from pwn import *
import re
conn = remote("chal00bq3ouweqtzva9xcobep6spl5m75fucey.ctf.sg", 56765)
def solve():
rows = []
for i in range(8):
conn.recvuntil(b"<-- ")
binstr = "0" * (8 - i - 1) + "1" + "0" * (i)
conn.send(binstr.encode() + b"\n")
resp = conn.recvline().decode()
match = re.search(r"--> (.*)\n", resp)
rows.append(int(match.group(1), 2))
for i in range(8):
resp = conn.recvuntil(b"<-- ").decode()
match = re.search(r"--> (.*)\n", resp)
challenge = match.group(1)
result = 0
for j in range(8):
if challenge[j] == "1":
result ^= rows[7 - j]
conn.send(bin(result)[2:].zfill(8).encode() + b"\n")
conn.interactive()
solve()========================
All challenges passed :)
========================
=================================================================
Here is your flag: TISC{d0N7_R0lL_Ur_0wN_cRyp70_7a25ee4d777cc6e9}
=================================================================