Commentary
Commentary
Platform: CUSTOM | Category: Web | Type: Challenge | Difficulty: Medium | OS: N/A | **Author: XESXOR Techniques: default_page_disclosure, host_header_manipulation, virtual_host_enumeration
Summary
Walkthrough of the CUSTOM Web Commentary. Task: find a hidden flag on an nginx web server. Solution: send an HTTP request to port 80 with the task name "commentary" as the Host header, triggering the nginx default page which contains the flag
Description
"You're currently speaking to my favorite host right now (ctf.rusec.club), but who's to say you even had to speak with one?" "Sometimes, the treasure to be found is just bloat that people forgot to remove."
Analysis
The challenge description contains several key hints:
- "favorite host" - Points to Host header manipulation
- "who's to say you even had to speak with one" - Suggests using a simple word instead of a full domain
- "Commentary" (task name) - This IS the Host header value to use!
- "bloat that people forgot to remove" - HTML comments in the response
The challenge exploits nginx virtual host behavior:
- When nginx receives a request with an unknown Host header, it returns the default server's page
- The default nginx page was modified to contain the flag in HTML comments
- The key insight was that HTTP (port 80) behaves differently than HTTPS - it doesn't redirect when Host header doesn't match
Solution
Failed Attempts
- Checked HTTPS with various Host headers (ctf.rusec.club, localhost, admin.ctf.rusec.club, etc.)
- Checked SSL certificate for alternative names (found wildcard *.ctf.rusec.club)
- Tried HTTP/1.0 requests without Host header
- Checked robots.txt, source maps, JS files
- Tried various HTTP methods (OPTIONS, TRACE, COMMENT)
Successful Approach
The crucial realization was:
- The task name "Commentary" was literally the Host header value
- HTTP (port 80) behaves differently than HTTPS
- nginx returns its default page for unknown virtual hosts
Exploit
bash read-only • copy allowedcurl -s -H "Host: commentary" http://ctf.rusec.club/
Response
html read-only • copy allowed<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> ... </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> ... <!-- you found me :3 --!> <!-- RUSEC{REDACTED} --!> <p><em>Thank you for using nginx.</em></p> </body> </html>
Technical Details
| Property | Value |
|---|---|
| Target | ctf.rusec.club (5.161.91.13) |
| Server | nginx/1.24.0 (Ubuntu) |
| Protocol | HTTP (port 80) |
| Vulnerability | Virtual host misconfiguration |
Lessons Learned
- Task name matters - The challenge name itself can be a crucial hint
- Try HTTP, not just HTTPS - Different protocols may have different configurations
- nginx default behavior - Unknown Host headers return the default server page
- HTML comments - Always check page source for hidden content
- Read hints carefully - "Commentary" + "comments" = HTML comments in response
Key Takeaways / Lessons
- Mastering default_page_disclosure, host_header_manipulation, virtual_host_enumeration was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-01-09 • CUSTOM • Commentary • Difficulty: Medium