Files
ssof_labs/pa/lab2/chall_requests.py
2025-11-20 17:46:30 +00:00

22 lines
537 B
Python

from requests import get
import re
BASE = "http://mustard.stt.rnl.tecnico.ulisboa.pt:25053"
resp = get(BASE+"/hello")
content = resp.content.decode('utf-8')
target = re.search(r"target ([0-9]+)", content).group(1)
print("Target:", target)
current = 0
while current != target:
resp = get(BASE+"/more", cookies=resp.cookies)
content = resp.content.decode('utf-8')
current = re.search(r"current value is: ([0-9]+)", content).group(1)
print("Current:", current)
resp = get(BASE+"/finish", cookies=resp.cookies)
print(resp.content)