Web Challenges

Conquest

Description

Our Mogambro is a lucid dreamer who has meticulously replicated one of his sessions in the form of the given website. Can you also complete the quest which Mogambro failed to do?

http://20.244.82.82:2913/arrow-up-right

Solution

This challenge felt more like misc rather then web.

First we are given a poem which we need to decipher:

In the realm of ones and zeros, I reside,  
A digital denizen, where circuits coincide.  
I calculate and compute, with lightning speed,  
Yet devoid of emotion, a machine indeed.  
What am I, a marvel of modern art,  
Playing my part, in the human-smart cart?

The only (most known) machine must refer to /robots.txt

User-Agent: *
Disallow: /tournament

Second puzzle:

The puzzle must have been solved, but we can bruteforce directory using wordlist. common.txtarrow-up-right wordlist is always goto for simple enumeration and in the end we get a hit: /tournament/humans.txt

To defeat the dragon request is made:

After playing around you can set slay to be really huge value to get the flag.

circle-check

Just Wierd Things

Description

You have the power to change some things. Now will you be mogambro or someone else? You might stumble across some red herrings...

meness

App: http://20.244.82.82:5000/arrow-up-right Source: justwierdthings.ziparrow-up-right

Analysis

If we carefully analyze source code we can see that res.render takes 2 arguments. Syntax: res.render(view [, locals] [, callback]).

circle-check

There's already known "exploit" which user introduces to the application: https://github.com/mde/ejs/issues/451arrow-up-right. To make use of exploit first we need to pollute locals variable and we can do that through error.

Application is using cookie-parserarrow-up-right package and if we lookup the docuentation:

In addition, this module supports special "JSON cookies". These are cookie where the value is prefixed with j:. When these values are encountered, the value will be exposed as the result of JSON.parse. If parsing fails, the original value will remain.

Knowing this we can construct payload with jwt=j:PAYLOAD

Shoutout to outsparkled for the explanation about semicolon encoding in the payload.

image

Detailed analysis of RCE: https://eslam.io/posts/ejs-server-side-template-injection-rce/arrow-up-right

Solution

Whatever command gets executed will not get displayed to us, so we need to exfiltrate that data. In this case we can use curl, since we know flag is located at /flag.txt (from Dockerfile) we just make request to any requestbin (I used beeceptor) and finally profit.

circle-check

Too Blind To See

Description

Mogambro, our rookie intern, just stepped foot into the prestigious Software Firm. His big moment, the first project review, is knocking at the door like a pesky neighbor. But wait! Somewhere in his app lurks a secret which the admins are not aware of, hidden behind the password 'fluffybutterfly'. Can you crack the code and rescue Mogambro from this password puzzle? The clock is ticking!

http://20.244.82.82:7000/arrow-up-right

Solution

Approach 1

On /login route there's 2 ways to login, normal and admin. We already suspect that there's already an SQLi, but where? Challenge title is another hint, so probably blind SQLi.

Finding the payload to work was tricky even after CTF ended. Shout out to daffainfoarrow-up-right for the help 👀.

image

DBMS seems SQLite3.

At this point we had to enumerate the database using blind injection attack, but I didnt want to write script for it and wanted to explore SQLMap a bit more.

Without SQLMap: PayloadsAllTheThings: SQLite Injectionarrow-up-right

Approach 2

Writeup by: slaeearrow-up-right: https://github.com/slaee/ret-CTF-writeups/tree/main/2024/bitsCTF/toblindtoseearrow-up-right

There was a form on main page:

The endpoint was also vulnarable to the SQLi and could have been exploited.

Flag

circle-check

Last updated