Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
web/no-connection (#34)
Browse files Browse the repository at this point in the history
* not connected

* solvepath!!1

Co-authored by: glacialcascade <[email protected]>
Co-authored by: awt-256 <[email protected]>
  • Loading branch information
mud-ali authored Aug 28, 2023
1 parent bf3f831 commit d1491be
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 0 deletions.
4 changes: 4 additions & 0 deletions no-connection/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:latest AS run

COPY . /usr/share/nginx/html

16 changes: 16 additions & 0 deletions no-connection/chall.yaml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions no-connection/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page | CTF</title>
<link rel="stylesheet" href="style.css">
<script src="main.js" defer></script>
</head>
<body>
<h1>Login</h1>

<form id="login_page">
<input type="text" id="username" placeholder="Username">
<input type="password" id="password" placeholder="Password">

<input type="submit" value="Login">
</form>
</body>
</html>
13 changes: 13 additions & 0 deletions no-connection/main.js
Original file line number Diff line number Diff line change
@@ -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('');}
10 changes: 10 additions & 0 deletions no-connection/solve.md
Original file line number Diff line number Diff line change
@@ -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.
39 changes: 39 additions & 0 deletions no-connection/style.css
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit d1491be

Please sign in to comment.