Skip to content

Commit

Permalink
Add makefile for building challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
ZetaTwo committed Aug 27, 2023
1 parent 7a83595 commit 9839e69
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
1 change: 1 addition & 0 deletions finals/challenges/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
handouts/
104 changes: 104 additions & 0 deletions finals/challenges/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
challenges: challenge-cheap-flights \
challenge-have-you-tried-ti-gnisrever \
challenge-hopscotch \
challenge-house-of-barbie \
challenge-ioctl-me-maybe \
challenge-jammer \
challenge-john-henry \
challenge-literally-just-gets \
challenge-lol-rwx \
challenge-noppenheimer \
challenge-pastez \
challenge-push-pop-automaton \
challenge-recracked \
challenge-shop \
challenge-snomelet \
challenge-the-way \
challenge-uleb4096


challenge-cheap-flights:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-cheap-flights cheap-flights/challenge
./extract-handout.sh finals-cheap-flights

challenge-have-you-tried-ti-gnisrever:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-have-you-tried-ti-gnisrever have-you-tried-ti-gnisrever/challenge
./extract-handout.sh finals-have-you-tried-ti-gnisrever

challenge-hopscotch:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-hopscotch hopscotch/challenge
./extract-handout.sh finals-hopscotch

challenge-house-of-barbie:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-house-of-barbie house-of-barbie/challenge
./extract-handout.sh finals-house-of-barbie

challenge-ioctl-me-maybe:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-ioctl-me-maybe ioctl-me-maybe/challenge
./extract-handout.sh finals-ioctl-me-maybe

challenge-jammer:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-jammer jammer/challenge
./extract-handout.sh finals-jammer

challenge-john-henry:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-john-henry john-henry/challenge
./extract-handout.sh finals-john-henry

challenge-literally-just-gets:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-literally-just-gets literally-just-gets/challenge
./extract-handout.sh finals-literally-just-gets

challenge-lol-rwx:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-lol-rwx lol-rwx/challenge
./extract-handout.sh finals-lol-rwx

challenge-noppenheimer:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-noppenheimer noppenheimer/challenge
./extract-handout.sh finals-noppenheimer

challenge-pastez:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-pastez pastez/challenge
./extract-handout.sh finals-pastez

challenge-push-pop-automaton:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-push-pop-automaton push-pop-automaton/challenge
./extract-handout.sh finals-push-pop-automaton

challenge-recracked:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-recracked recracked/challenge
./extract-handout.sh finals-recracked

challenge-shop:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-shop shop/challenge
./extract-handout.sh finals-shop

challenge-snomelet:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-snomelet snomelet/challenge
./extract-handout.sh finals-snomelet

challenge-the-way:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-the-way the-way/challenge
./extract-handout.sh finals-the-way

challenge-uleb4096:
DOCKER_BUILDKIT=1 docker build -t livectf:finals-uleb4096 uleb4096/challenge
./extract-handout.sh finals-uleb4096

.PHONY: challenge-cheap-flights \
challenge-have-you-tried-ti-gnisrever \
challenge-hopscotch \
challenge-house-of-barbie \
challenge-ioctl-me-maybe \
challenge-jammer \
challenge-john-henry \
challenge-literally-just-gets \
challenge-lol-rwx \
challenge-noppenheimer \
challenge-pastez \
challenge-push-pop-automaton \
challenge-recracked \
challenge-shop \
challenge-snomelet \
challenge-the-way \
challenge-uleb4096
8 changes: 8 additions & 0 deletions finals/challenges/extract-handout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e
set -x

mkdir -p handouts/
CONTAINER_ID=$(docker create "livectf:$1")
docker cp "$CONTAINER_ID:/handout.tar.gz" "handouts/$1-handout.tar.gz"
docker rm "$CONTAINER_ID"

0 comments on commit 9839e69

Please sign in to comment.