File tree Expand file tree Collapse file tree 5 files changed +65
-14
lines changed
chapters/web-application-security/web-basics/drills/readme Expand file tree Collapse file tree 5 files changed +65
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Web: Web basics and browser security model: Readme
44
55## Description
66
7- Get the flag from [ readme] ( http://141.85.224.118:8092 /readme/ ) .
7+ Get the flag from [ readme] ( http://141.85.224.101:30013 /readme/ ) .
88
99Score: 25
1010
Original file line number Diff line number Diff line change 1+ FROM php:7.2-apache AS builder
2+
3+ ARG FLAG
4+ COPY src/index.template.html /tmp/index.template.html
5+ RUN sed "s/__TEMPLATE__/${FLAG}/g" /tmp/index.template.html > /tmp/index.html
6+
17FROM php:7.2-apache
28
3- COPY /src /var/www/html/readme/
9+ COPY --from=builder /tmp/index.html /var/www/html/readme/index.html
Original file line number Diff line number Diff line change 1- EXTERNAL_PORT := 8092
1+ EXTERNAL_PORT := 30013
2+ INTERNAL_PORT := 80
23IMG_NAME := sss-web-01_readme
3- FILE_TEMPLATE := ../src/index.template.html
4- FILE_SRC := ../src/index.html
4+ CONT_NAME := ${IMG_NAME}
5+ FLAG_FILE := ../flag
56
6- include activity.mk
7+ ifndef CONT_NAME
8+ $(error You need to set a name for IMG_NAME variable(e.g. sss-web-01_activity-name).)
9+ endif
10+
11+ ifndef EXTERNAL_PORT
12+ $(error You need to set EXTERNAL_PORT variable.)
13+ endif
14+
15+ run : build
16+ docker run -d -p $(EXTERNAL_PORT ) :$(INTERNAL_PORT ) --name $(CONT_NAME ) -t $(IMG_NAME )
17+
18+ build :
19+ docker build --build-arg FLAG=" $$ (cat $( FLAG_FILE) )" -t $(IMG_NAME ) -f Dockerfile ..
20+
21+ stop :
22+ docker stop $(CONT_NAME )
23+
24+ clean : stop
25+ docker rm $(IMG_NAME )
26+ docker image rm $(IMG_NAME ) :latest
27+
28+ .PHONY : run build stop clean
Original file line number Diff line number Diff line change 1+ namespace : web-basics
2+
3+ challenge :
4+ name : readme
5+ category : web-basics
6+
7+ image :
8+ repository : sss-web-01_readme
9+ tag : latest
10+ pullPolicy : IfNotPresent
11+
12+ replicaCount : 1
13+
14+ containerPort : 80
15+
16+ service :
17+ type : NodePort
18+ port : 80
19+ nodePort : 30013
20+
21+ healthCheck :
22+ enabled : true
23+ path : /readme/
24+ initialDelaySeconds : 5
25+ periodSeconds : 10
Original file line number Diff line number Diff line change 11#! /bin/bash
2- PORT=8092
2+ PORT=30013
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.118:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Readme
You can’t perform that action at this time.
0 commit comments