๐ Whispers of the Moonbeam
A detailed write-up of the Web challenge 'Whispers of the Moonbeam' from Cyber Apocalypse CTF - 2025
๐ Challenge Overview
Category Details Additional Info ๐ Event Cyber Apocalypse CTF - 2025 Event Link ๐ฐ Category Web ๐ ๐ Points 1000 Out of 1000 total โญ Difficulty ๐ข Easy Personal Rating: 1/10 ๐ค Author Unknown Profile ๐ฎ Solves (At the time of flag submission) 34 solve rate ๐ Date 21-03-2025 Cyber Apocalypse CTF - 2025 ๐ฆพ Solved By mH4ck3r0n3 Team: QnQSec
๐ Challenge Information
In the heart of Valeria’s bustling capital, the Moonbeam Tavern stands as a lively hub of whispers, wagers, and illicit dealings. Beneath the laughter of drunken patrons and the clinking of tankards, it is said that the tavern harbors more than just ale and merrimentโit is a covert meeting ground for spies, thieves, and those loyal to Malakar’s cause. The Fellowship has learned that within the hidden backrooms of the Moonbeam Tavern, a crucial piece of information is being tradedโthe location of the Shadow Veil Cartographer, an informant who possesses a long-lost map detailing Malakarโs stronghold defenses. If the fellowship is to stand any chance of breaching the Obsidian Citadel, they must obtain this map before it falls into enemy hands.
๐ฏ Challenge Files & Infrastructure
Provided Files
1
Files: None
๐ Initial Analysis
First Steps
Initially, the website appears as follows:
By clicking on “Enter Tavern,” I was redirected to the following page:
where it was possible to execute commands. If we pay attention, there is a message at the bottom of the page:
Tip: Use โโ for history, Tab for completion, ; for command injection.
From this, we can already infer what it’s about…
๐ฌ Vulnerability Analysis
Potential Vulnerabilities
- OS Command Injection
๐ฏ Solution Path
Exploitation Steps
Initial setup
First, I used the
help
command to list all the available commands:Then I tried the
gossip
command:and apparently, it lists directories, very similar to
ls
… In fact, when I sentgossip a
:I got, as we can see, the error message
Command failed: ls a, ls: a: No such file or directory
. So, it is indeed executingls
. Let’s move on to the next phase.
Exploitation
Now, as suggested, I simply added
;
at the end of the command, which in bash is used as a command separator. This means that if we want to execute multiple commands inline, we just need to writecommand1;command2
. That said, I sentgossip;cat flag.txt
, and by doing so, I read the contents of theflag.txt
file, thus obtaining the flag.
Flag capture
๐ ๏ธ Exploitation Process
Approach
The automatic exploit sends a
POST
request to the/api/command
endpoint (I found this by looking at the request made when sending a command), sending the payloadcommand;cat flag.txt
. Once the response is received, it extracts the flag using a regex.
๐ฉ Flag Capture
FlagHTB{Sh4d0w_3x3cut10n_1n_Th3_M00nb34m_T4v3rn_962c3fd0bdd17b2ae33bfeb7144d7d34}
Proof of Execution
๐ง Tools Used
Tool Purpose Python Exploit
๐ก Key Learnings
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
๐ Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:02 | From start to flag |
Global Ranking (At the time of flag submission) | 34/6512 | Challenge ranking |
Points Earned | 1000 | Team contribution |
Created: 21-03-2025 โข Last Modified: 21-03-2025 *Author: mH4ck3r0n3 โข Team: QnQSec