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

Commit

Permalink
web/hidden-values (#25)
Browse files Browse the repository at this point in the history
* chall

* yaml

* yaml fix

* deploy stuff

---------

Co-authored-by: mud-ali <[email protected]>
  • Loading branch information
Jack-Crowley and mud-ali authored Aug 26, 2023
1 parent c19f2c2 commit 36ac5c6
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hidden-values/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
npm-debug.log
chall.yaml
13 changes: 13 additions & 0 deletions hidden-values/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm ci --omit=dev

COPY . .

EXPOSE 3000

CMD ["node", "app.js"]
17 changes: 17 additions & 0 deletions hidden-values/chall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Hidden Values
categories:
- webex
value: 50
flag: camp{YOu_WerENt_5Upp0sE_T0_se3_THI5_55d28b16d94c3}
description: |-
I have the right username and password, `bcaCTFAdmin2?` and `admin!?!?!?!`, but it's not letting me log in.
Can you figure out why?
hints:
- How do forms send values?
authors:
- Jack Crowley
visible: true
deploy:
web:
build: ./src/
expose: 3000/tcp
21 changes: 21 additions & 0 deletions hidden-values/src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const express = require('express');
const app = express();
const flag = "camp{YOu_WerENt_5Upp0sE_T0_se3_THI5_55d28b16d94c3}"

app.use(express.static(__dirname + '/public'));
app.use(express.urlencoded({ extended: false }));

app.get('/', (req, res) => {
res.sendFile(__dirname + '/index.html');
});

app.post('/', (req, res) => {
if (req.body.username == "bcaCTFAdmin2?" && req.body.password == "admin!?!?!?!") {
res.json({"flag":flag})
}
else res.redirect("/")
})

app.listen(3000, () => {
console.log('http://localhost:3000');
});
50 changes: 50 additions & 0 deletions hidden-values/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/index.css">
</head>

<body>
<div class="screen">
<div class="login">
<h1>Login</h1>
<form action="/" method="post">
<input type="text" class="username" name="notUsername" placeholder="Username...">
<input type="password" class="password" name="notPassword" placeholder="Password...">
<div class="css">
<div>
<div>
<div>
<div>
<div>
<div>
<span>
<div>
<div>
<input type="text" name="username" class="notUsername">
</div>
</div>
</span>
</div>
</div>
</div>
<div>
<input type="password" name="password" class="notPassword">
</div>
</div>
</div>
<div>
</div>
</div>
</div>
<input type="submit" value="Submit" class="submit">
</form>
</div>
</div>
</body>

</html>
Loading

0 comments on commit 36ac5c6

Please sign in to comment.