diff --git a/Dockerfile b/Dockerfile index bd37fe2..177d596 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7 +FROM python:3.7 as build RUN pip install pipenv @@ -6,4 +6,10 @@ RUN pip install pipenv WORKDIR /app COPY . /app -RUN pipenv install --system --deploy --ignore-pipfile \ No newline at end of file +RUN pipenv install --system --deploy --ignore-pipfile + +RUN mkdocs build + +FROM nginx:alpine +COPY --from=build /app/site /usr/share/nginx/html +EXPOSE 80 \ No newline at end of file diff --git a/Pipfile b/Pipfile index 8951484..561e66d 100644 --- a/Pipfile +++ b/Pipfile @@ -9,6 +9,7 @@ pylint = "*" [packages] mkdocs = "*" +mkdocs-bootswatch = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 08d6b18..c7a8d55 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d94cad0dc30488627958d67d89ddc51fed636a03f30aa583585e6ee8247086f5" + "sha256": "875711ee7e44ef60b24f4cfb89e0c6894741eededcd39192bdc2fd3d32134063" }, "pipfile-spec": 6, "requires": { @@ -85,6 +85,14 @@ "index": "pypi", "version": "==1.0.4" }, + "mkdocs-bootswatch": { + "hashes": [ + "sha256:1abe0b2ba0af643092202ec33e709d6cd06881bade66e2447c6c10fdb4bcccfa", + "sha256:6be56764675814036a507d32828710e93dbe3e7aced2cdd820b946a3ebf2308e" + ], + "index": "pypi", + "version": "==1.0" + }, "pyyaml": { "hashes": [ "sha256:57acc1d8533cbe51f6662a55434f0dbecfa2b9eaf115bede8f6fd00115a0c0d3", diff --git a/docs/easy.md b/docs/easy.md index a411fae..c277772 100644 --- a/docs/easy.md +++ b/docs/easy.md @@ -2,4 +2,5 @@ > These challenges are considered easy, they basically guide you to what to do. Do remember to read everything correctly okay? ## Finally -You are not a master yet, but you can get closer [here](/medium) \ No newline at end of file +You are not a master yet, but you can get closer [here](/medium) + \ No newline at end of file diff --git a/docs/hard.md b/docs/hard.md index 58cb243..02d35be 100644 --- a/docs/hard.md +++ b/docs/hard.md @@ -2,4 +2,5 @@ > These challenges simply don't tell you what to do at all, these are supposed to be hard for first/second year CSE students. ## Finally -Yeah, you are a master now, and I hope you had fun! - J \ No newline at end of file +Yeah, you are a master now, and I hope you had fun! - J + \ No newline at end of file diff --git a/docs/js/verify.js b/docs/js/verify.js new file mode 100644 index 0000000..4d8547d --- /dev/null +++ b/docs/js/verify.js @@ -0,0 +1,28 @@ +function httpGet(theUrl, elem) { + function reqListener() { + let res = this.responseText + if(res === "wrong"){ + alert("Nope, sorry. This is the wrong key!") + }else if(res === "nope" || res === "missing"){ + alert(`Could you send a message to J00LZ##9386 on Discord with the challenge name, he apparently misconfigured this... (${res})`) + }else if(res === "ok"){ + alert("Good job! You solved the challenge!") + } + } + + var oReq = new XMLHttpRequest(); + oReq.addEventListener("load", reqListener); + oReq.open("GET", theUrl); + oReq.send(); +} + +function check(challenge, elem) { + flag = document.querySelector(`input#${elem}`).value + flagExp = flag.match(/(?:flag)\{([\w]+)\}/i) + if(flagExp == null || flagExp == undefined){ + alert("That isn't even a flag?") + return + } + console.log(flagExp) + httpGet(`https://challengeverify.voidcorp.nl/${challenge}/${flagExp[1]}`, elem) +} \ No newline at end of file diff --git a/docs/medium.md b/docs/medium.md index dc13342..ba0b715 100644 --- a/docs/medium.md +++ b/docs/medium.md @@ -3,17 +3,22 @@ ## Socks to be you ### The story so far -Our friendly IT guy John has set up a hidden service to control his VM's. -The only problem is that his rival in the company, Dave, kind of wants to screw John over. -This is not an issue for John, he is quite capable with coding and knows exactly which commands to use. This is quite useful when he wants to hide the commands from Dave. -Dave did however figure out where the server is hosted: [wsecho.voidcorp.nl](https://wsecho.voidcorp.nl)! -Now dave wants to find John's password to really screw him over. He knows dave so it probably isn't hidden too well... -#### Your mission +> Our friendly IT guy John has set up a hidden service to control his VM's. +> The only problem is that his rival in the company, Dave, kind of wants to screw John over. +> This is not an issue for John, he is quite capable with coding and knows exactly which commands to use. +> This is quite useful when he wants to hide the commands from Dave. +> Dave did however figure out where the server is hosted: [johndoor.voidcorp.nl](https://johndoor.voidcorp.nl)! +> Now Dave wants to find John's password to really screw him over. +> He knows John so it probably isn't hidden too well... + + +### Your mission 1. Hack into the server 2. Read the hidden password (format=`flag{xxx}`) -3. Report back to Dave (aka the sender of this mission) with the password! +3. ## Finally -Getting closer to being considered a master, but you'll have to get the rank [here](/hard)! \ No newline at end of file +Getting closer to being considered a master, but you'll have to get the rank [here](/hard)! + \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index fbc2b96..b3b95e7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,7 +6,7 @@ nav: - Hard: hard.md - About: about.md theme: - name: mkdocs + name: slate shortcuts: help: 191 # ? next: 78 # n