Skip to content

Commit

Permalink
pow: catch EOF (#279)
Browse files Browse the repository at this point in the history
* pow: catch EOF

* Automated commit: update images.
  • Loading branch information
sroettger authored Mar 29, 2021
1 parent 4a06c8e commit 7bb93f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/challenge-templates/pwn/challenge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN /usr/sbin/useradd --no-create-home -u 1000 user
COPY flag /
COPY chal /home/user/

FROM gcr.io/kctf-docker/challenge@sha256:e550af5df266cb89a26ace1ba5dcc685981f01d1cb61e45a898cce0c9753de7a
FROM gcr.io/kctf-docker/challenge@sha256:6dd60da626bc43bf3175d9d7436006db5acc7710d5d1b7006ab53e718fe51e40

COPY --from=chroot / /chroot

Expand Down
2 changes: 1 addition & 1 deletion dist/challenge-templates/web/challenge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ COPY web-servers /web-servers

COPY flag /

FROM gcr.io/kctf-docker/challenge@sha256:e550af5df266cb89a26ace1ba5dcc685981f01d1cb61e45a898cce0c9753de7a
FROM gcr.io/kctf-docker/challenge@sha256:6dd60da626bc43bf3175d9d7436006db5acc7710d5d1b7006ab53e718fe51e40

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends tzdata apache2 \
Expand Down
2 changes: 1 addition & 1 deletion dist/challenge-templates/xss-bot/challenge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/kctf-docker/challenge@sha256:e550af5df266cb89a26ace1ba5dcc685981f01d1cb61e45a898cce0c9753de7a
FROM gcr.io/kctf-docker/challenge@sha256:6dd60da626bc43bf3175d9d7436006db5acc7710d5d1b7006ab53e718fe51e40

RUN apt-get update && apt-get install -y gnupg2

Expand Down
7 changes: 6 additions & 1 deletion docker-images/challenge/pow.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ def main():
sys.stdout.flush()
solution = ''
while not solution:
solution = sys.stdin.readline().strip()
line = sys.stdin.readline()
if not line:
sys.stdout.write("EOF")
sys.stdout.flush()
sys.exit(1)
solution = line.strip()

if verify_challenge(challenge, solution):
sys.stdout.write("Correct\n")
Expand Down

0 comments on commit 7bb93f6

Please sign in to comment.