Contents

๐ŸŒ Whispers of the Moonbeam

A detailed write-up of the Web challenge 'Whispers of the Moonbeam' from Cyber Apocalypse CTF - 2025

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š 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:

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/site_presentation.png
Site Presentation

By clicking on “Enter Tavern,” I was redirected to the following page:

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/terminal.png
Terminal

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:

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/help.png
Help

Then I tried the gossip command:

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/gossip.png
Gossip

and apparently, it lists directories, very similar to ls… In fact, when I sent gossip a:

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/gossipa.png
Gossip 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 executing ls. 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 write command1;command2. That said, I sent gossip;cat flag.txt, and by doing so, I read the contents of the flag.txt file, thus obtaining the flag.

Flag capture

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/manual_flag.png
Manual Flag

๐Ÿ› ๏ธ 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 payload command;cat flag.txt. Once the response is received, it extracts the flag using a regex.

๐Ÿšฉ Flag Capture

Flag

HTB{Sh4d0w_3x3cut10n_1n_Th3_M00nb34m_T4v3rn_962c3fd0bdd17b2ae33bfeb7144d7d34}

Proof of Execution

/images/CyberApocalypseCTF-2025/Web/WhispersOfTheMoonbeam/automated_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง 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