Create Docker image for JS Login
This commit is contained in:
parent
a177bec498
commit
fd6123e72c
8
js_login/Dockerfile
Normal file
8
js_login/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM python:3.12
|
||||||
|
|
||||||
|
COPY src/ /web
|
||||||
|
|
||||||
|
COPY docker/start.sh /start.sh
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/start.sh"]
|
@ -1,3 +1,8 @@
|
|||||||
# JsLogin
|
# JsLogin
|
||||||
|
|
||||||
Taken from: https://github.com/mazipan/login-page-css/tree/master/src/18-instagram
|
Taken from: https://github.com/mazipan/login-page-css/tree/master/src/18-instagram
|
||||||
|
|
||||||
|
## Run the image
|
||||||
|
```bash
|
||||||
|
docker run --rm --name unsafe_login --env FLAG='FLAG{JSLOGIN}' -p 3570:8080 -it pierre42100/unsafe-js-login
|
||||||
|
```
|
1
js_login/build.sh
Normal file
1
js_login/build.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
sudo docker build -t pierre42100/unsafe-js-login .
|
13
js_login/docker/start.sh
Normal file
13
js_login/docker/start.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [[ -z "${FLAG}" ]]; then
|
||||||
|
echo "Please set the FLAG environment variable!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $FLAG > /web/flag.txt
|
||||||
|
|
||||||
|
echo "Starting HTTP server..."
|
||||||
|
|
||||||
|
cd /web
|
||||||
|
python3 -m http.server 8080
|
@ -8,5 +8,5 @@ form.addEventListener("submit", (e) => {
|
|||||||
if (email === "sesame@ouvretoi.com" && password === "topsecret")
|
if (email === "sesame@ouvretoi.com" && password === "topsecret")
|
||||||
location.href = "/flag.txt";
|
location.href = "/flag.txt";
|
||||||
else
|
else
|
||||||
alert("Identifiants incorrects, veuillez réessayer !");
|
alert("Invalid credentials, please try again!");
|
||||||
})
|
})
|
Loading…
x
Reference in New Issue
Block a user