Skip to content

Commit

Permalink
(web): Start contianer with prod
Browse files Browse the repository at this point in the history
  • Loading branch information
saintbarber committed Apr 30, 2024
1 parent 0f60d8f commit 968311a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 33 deletions.
24 changes: 2 additions & 22 deletions web/shodanql/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
# ShodanQL

[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/cybermouflons/CCSC-CTF-2023/master/web/shodanql/docker-compose.yml)
JWT forging with JKU header injection


**Category**: web
DNS rebinding to bypass a localhost filter

**Author**: sAINT_barber

## Description

We found this website that seems to list all systems OrionTech as owned.
Can you access the admin page and take the site down for good?



## Run locally

Launch challenge:
```
curl -sSL https://raw.githubusercontent.com/cybermouflons/CCSC-CTF-2023/master/web/shodanql/docker-compose.yml | docker compose -f - up -d
```

Shutdown challenge:
```
curl -sSL https://raw.githubusercontent.com/cybermouflons/CCSC-CTF-2023/master/web/shodanql/docker-compose.yml | docker compose -f - down
```
1 change: 1 addition & 0 deletions web/shodanql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ services:
flag: CCSC{pwn1nG_w1th_SQL1_1nj3ct10n_s1nc3_1998}



11 changes: 3 additions & 8 deletions web/shodanql/setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ COPY middleware/ middleware/
COPY server.js server.js
COPY database.js database.js


# COPY database.db database.db


RUN npm install

EXPOSE 3003
# CMD ["npm", "run", "dev"] # Develpment only

EXPOSE 3000
CMD ["npm", "run", "dev"] # Develpment only

# CMD ["npm", "run", "start"] # prod
CMD ["npm", "run", "start"] # prod
2 changes: 1 addition & 1 deletion web/shodanql/setup/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ router.get('/', async (req, res) => {

});

router.get('/admin',isAdmin, (req, res) => {
router.get('/admin', (req, res) => {

const flag = process.env.flag

Expand Down
4 changes: 2 additions & 2 deletions web/shodanql/setup/views/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ <h4 class="fw-bolder">Welcome Admin user!</h4>
<section class="">
<div class="container py-5">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
<div class="col-8">
<div class="card bg-light shadow-lg rounded" style="border-radius: 1rem;">
<div class="card-body p-5 text-center">

<h4 class="card-title fw-bold mb-3">{{flag}}</h4>
<h3 class="card-title ">{{flag}}</h3>
</div>

</div>
Expand Down

0 comments on commit 968311a

Please sign in to comment.