Create Docker image for JS Login

This commit is contained in:
Pierre HUBERT 2025-01-31 12:05:38 +01:00
parent a177bec498
commit fd6123e72c
5 changed files with 29 additions and 2 deletions

8
js_login/Dockerfile Normal file
View 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"]

View File

@ -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
View File

@ -0,0 +1 @@
sudo docker build -t pierre42100/unsafe-js-login .

13
js_login/docker/start.sh Normal file
View 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

View File

@ -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!");
}) })