From 31c10f1446779b635e145a30300302c37f3a8549 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Mon, 9 Oct 2023 21:01:28 +0200 Subject: [PATCH] Add hint for LD_PRELOAD --- sujet_tp.typ | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sujet_tp.typ b/sujet_tp.typ index a8be194..c91fc1f 100644 --- a/sujet_tp.typ +++ b/sujet_tp.typ @@ -55,9 +55,12 @@ from string import ascii_lowercase, ascii_uppercase, digits from subprocess import check_output alphabet = ascii_lowercase + ascii_uppercase + digits +env = { + "LD_PRELOAD": "..." # TODO +} -def request(url: str) -> str: +def request(url: str) -> int: """Executes the client binary with the following URL, and checks its output.""" - # TODO: extraire l'information utile pour l'attaque - return check_output(["./client", "127.0.0.1", "8080", url]).decode('utf-8') + out = check_output(["./client", "127.0.0.1", "8080", url], env=env).decode('utf-8') + return int(out.split(' ')[1]) ```