From d1491be500440b7a02d5e6cf5edf4eee375c5b24 Mon Sep 17 00:00:00 2001 From: mudasir <96320211+mud-ali@users.noreply.github.com> Date: Mon, 28 Aug 2023 08:07:48 -0400 Subject: [PATCH] web/no-connection (#34) * not connected * solvepath!!1 Co-authored by: glacialcascade <11969863+glacialcascade@users.noreply.github.com> Co-authored by: awt-256 <68395886+awt-256@users.noreply.github.com> --- no-connection/Dockerfile | 4 ++++ no-connection/chall.yaml | 16 ++++++++++++++++ no-connection/index.html | 20 ++++++++++++++++++++ no-connection/main.js | 13 +++++++++++++ no-connection/solve.md | 10 ++++++++++ no-connection/style.css | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 102 insertions(+) create mode 100644 no-connection/Dockerfile create mode 100644 no-connection/chall.yaml create mode 100644 no-connection/index.html create mode 100644 no-connection/main.js create mode 100644 no-connection/solve.md create mode 100644 no-connection/style.css diff --git a/no-connection/Dockerfile b/no-connection/Dockerfile new file mode 100644 index 0000000..03f9259 --- /dev/null +++ b/no-connection/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:latest AS run + +COPY . /usr/share/nginx/html + diff --git a/no-connection/chall.yaml b/no-connection/chall.yaml new file mode 100644 index 0000000..26bd21b --- /dev/null +++ b/no-connection/chall.yaml @@ -0,0 +1,16 @@ +name: No Connection +categories: + - webex +value: 25 +flag: camp{d0n7_aUth_oN_C!i3n7_51d3_bhiwsdwflowld} +description: |- + My internet sucks, so I decided to move my login page to work offline. +hints: + - No need to contact any servers! Everything happens right at home. +authors: + - Mudasir +visible: true +deploy: + web: + build: . + expose: 80/tcp \ No newline at end of file diff --git a/no-connection/index.html b/no-connection/index.html new file mode 100644 index 0000000..e45caa3 --- /dev/null +++ b/no-connection/index.html @@ -0,0 +1,20 @@ + + + + + + Login Page | CTF + + + + +

Login

+ +
+ + + + +
+ + \ No newline at end of file diff --git a/no-connection/main.js b/no-connection/main.js new file mode 100644 index 0000000..edcfa57 --- /dev/null +++ b/no-connection/main.js @@ -0,0 +1,13 @@ +const form = document.getElementById('login_page'); + +form.addEventListener('submit', (e) => { + e.preventDefault(); + const username = document.getElementById('username').value; + const password = document.getElementById('password').value; + + if (username === 'dewoirf239bf3n9ddks' && password === '923nfr8idj91ws1m8dumnfed') { + alert(getFlag()); + } +}); + +function getFlag() {let fr = ['\x82', 'i', 'q', '|', 't', 'q','k', '|', 'i', 'x', '|', 'n','m', 'g', 'd', '8', 'i', '6',':', 'd', '<', 's', '8', 'n','&', 'H', 'd', 'S', 't', 'd','m', 'y', 'Z', 'f', 'd', '<','s', '5', 'i', '\x80', 'u', 'r','f', 'h'];let rf = fr.reverse();let o = rf.map((c) => {return String.fromCharCode(c.charCodeAt(0) - 5);});return o.join('');} \ No newline at end of file diff --git a/no-connection/solve.md b/no-connection/solve.md new file mode 100644 index 0000000..5d3f506 --- /dev/null +++ b/no-connection/solve.md @@ -0,0 +1,10 @@ +open up inspect element + +read JS + +go to console + +run `getFlag()` + + +or you could steal the username and password from the javascript, up to you. \ No newline at end of file diff --git a/no-connection/style.css b/no-connection/style.css new file mode 100644 index 0000000..1eca6d9 --- /dev/null +++ b/no-connection/style.css @@ -0,0 +1,39 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300&display=swap'); + +body { + background-color: #3f3f3f; + color: white; + font-family: "Inter", sans-serif; + font-weight: 200; + /* padding: 2rem 30vw; */ +} + +h1 { + font-size: 2rem; + font-weight: 300; + margin-bottom: 1rem; + text-align: center; +} + +form { + margin: auto; + display: flex; + flex-direction: column; + justify-content: space-around; + margin: 0 auto; + min-width: max-content; + width: 25%; + align-items: center; + background-color: #3c583a; + height: 35vh; + min-height: max-content; + border-radius: 3rem; + padding: 2rem; +} + +form input { + min-width: max-content; + width: 40%; + padding: 0.25rem; + border-radius: 0.35rem; +} \ No newline at end of file