From 6b82e4e2fb8756340e1217e7b298e0272f23a3fe Mon Sep 17 00:00:00 2001 From: Arthur Taylor Date: Fri, 25 Aug 2023 10:59:10 +0200 Subject: [PATCH] `custom-socat` challenge is broken because the wrote port is exported Export the correct port --- examples/custom/Dockerfile | 3 +-- examples/custom/solver/solve.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/custom/Dockerfile b/examples/custom/Dockerfile index ed86214..bf3ff2a 100644 --- a/examples/custom/Dockerfile +++ b/examples/custom/Dockerfile @@ -18,7 +18,6 @@ RUN echo $FLAG | openssl aes-256-cbc -k unguessable -pbkdf2 -out secret.enc # These "artifacts" are available to competitors for download RUN tar czvf /challenge/artifacts.tar.gz secret.enc time.txt -CMD socat TCP4-LISTEN:4242,reuseaddr,fork exec:'echo -n openssl aes-256-cbc -d -k unguessable -pbkdf2 -in secret.enc' +CMD socat TCP4-LISTEN:4200,reuseaddr,fork exec:'echo -n openssl aes-256-cbc -d -k unguessable -pbkdf2 -in secret.enc' EXPOSE 4200 -# PUBLISH 4200 AS socat diff --git a/examples/custom/solver/solve.py b/examples/custom/solver/solve.py index cdd1eb7..6b42f34 100644 --- a/examples/custom/solver/solve.py +++ b/examples/custom/solver/solve.py @@ -3,7 +3,7 @@ import subprocess c = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -c.connect(("challenge", 4242)) +c.connect(("challenge", 4200)) command = c.recv(4096).decode() results = subprocess.run(command, capture_output=True, shell=True, text=True)