-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·74 lines (50 loc) · 2.19 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
docker rmi $(docker images -f "dangling=true" -q) 2> /dev/null
NC_PROBLEMS=("canary" "simple_bof" "fsb" "rop" "pie" "64bof")
PORT=9000
USER=keeper
for PROBLEM in ${NC_PROBLEMS[@]}
do
PROBLEM_LOWER=$(echo $PROBLEM | tr '[:upper:]' '[:lower:]')
docker build --build-arg PROBLEM=${PROBLEM} --build-arg PORT=${PORT} --build-arg USER=${USER} -t ${PROBLEM_LOWER} -f Dockerfile.nc .
docker run --name $PROBLEM -p $PORT:$PORT -i $PROBLEM_LOWER_LOWER &
let PORT=${PORT}+1
done
###########################################################
PYTHON_PROBLEMS=("basic_zkp")
for PROBLEM in ${PYTHON_PROBLEMS[@]}
do
PROBLEM_LOWER=$(echo $PROBLEM | tr '[:upper:]' '[:lower:]')
docker build --build-arg PROBLEM=${PROBLEM} --build-arg PORT=${PORT} --build-arg USER=${USER} -t ${PROBLEM_LOWER} -f Dockerfile.python .
docker run --name $PROBLEM -p $PORT:$PORT -i $PROBLEM_LOWER &
let PORT=${PORT}+1
done
###########################################################
FLASK_PROBLEMS=("goback")
for PROBLEM in ${FLASK_PROBLEMS[@]}
do
PROBLEM_LOWER=$(echo $PROBLEM | tr '[:upper:]' '[:lower:]')
docker build --build-arg PROBLEM=${PROBLEM} --build-arg PORT=${PORT} --build-arg USER=${USER} -t ${PROBLEM_LOWER} -f Dockerfile.flask .
docker run --name $PROBLEM -p $PORT:$PORT -i $PROBLEM_LOWER &
let PORT=${PORT}+1
done
###########################################################
PHP_PROBLEMS=("keeper_bird" "obfuscation" "shop" "lord")
for PROBLEM in ${PHP_PROBLEMS[@]}
do
PROBLEM_LOWER=$(echo $PROBLEM | tr '[:upper:]' '[:lower:]')
docker build --build-arg PROBLEM=${PROBLEM} --build-arg PORT=${PORT} --build-arg USER=${USER} -t ${PROBLEM_LOWER} -f Dockerfile.php .
docker run --name $PROBLEM -p $PORT:$PORT -i $PROBLEM_LOWER &
let PORT=${PORT}+1
done
###########################################################
OTHER_PROBLEMS=("xmlparser" "lighttpd")
for PROBLEM in ${OTHER_PROBLEMS[@]}
do
PROBLEM_LOWER=$(echo $PROBLEM | tr '[:upper:]' '[:lower:]')
cd ./problem/$PROBLEM
docker build --build-arg PROBLEM=${PROBLEM} --build-arg PORT=${PORT} --build-arg USER=${USER} -t ${PROBLEM_LOWER} -f Dockerfile .
docker run --name $PROBLEM -p $PORT:$PORT -i $PROBLEM_LOWER &
let PORT=${PORT}+1
cd ../..
done