Web developers sometimes leave behind valuable secrets in places they think nobody will look. While most users only see the polished surface of a website, curious minds know that the real treasures often lie just beneath. This beginner-friendly challenge will teach you a fundamental skill every security professional needs: the art of looking beyond the obvious. 🕵️ Ready to discover what's been there all along?
Launch your dedicated machine to begin hacking
This walkthrough explains how to hack the lab and capture the flags. For help with Learning Mode questions, use the Request Hint button next to each question.
This challenge demonstrates two critical OWASP Top 10 vulnerabilities working together:
Files are accessible without authentication simply by knowing their URL path - the #1 vulnerability in OWASP Top 10 (2021)
Sensitive file paths are exposed in HTML source code comments that developers accidentally left behind
Navigate to the challenge URL in your web browser:
https://lab.hdna.me/4-secrets-in-source
You'll see a professional corporate website for "TechNova Solutions" with information about their services and team. The visible page appears completely normal with no obvious security issues.
The key insight is that web pages contain more than what's visible. When you visit a website, your browser downloads HTML, CSS, and JavaScript files. While these render into the visual page, the underlying source code often contains additional information.
Information Disclosure vulnerabilities occur when applications unintentionally expose sensitive data through:
To examine the underlying HTML source code, you have several options:
Method 1: Keyboard Shortcut (Fastest)
Windows/Linux: Ctrl + U macOS: Cmd + Option + U
Method 2: Right-Click Menu
Method 3: URL Prefix
view-source:https://lab.hdna.me/4-secrets-in-source
Once you have the source code open, examine it carefully. Look specifically for HTML comments, which are enclosed in <!-- --> tags.
Near the bottom of the source code (around line 63), you'll find a developer comment:
<!-- TODO: move the flag "/anwvdzqtcucr/flag.txt" in a more secure location -->
This is a classic example of Information Disclosure - a developer left a TODO note revealing:
/anwvdzqtcucr/flag.txtNow that we have the file path, we can test if the file has proper access controls. The developer's comment suggests it doesn't - they want to "move it to a more secure location" but haven't done so yet.
This is where Broken Access Control comes into play. The file can be accessed directly without any authentication simply by constructing the full URL.
Method 1: Using a web browser, navigate to:
https://lab.hdna.me/4-secrets-in-source/anwvdzqtcucr/flag.txt
Method 2: Using curl from the command line:
curl https://lab.hdna.me/4-secrets-in-source/anwvdzqtcucr/flag.txt
Method 3: Using wget:
wget -qO- https://lab.hdna.me/4-secrets-in-source/anwvdzqtcucr/flag.txt
The file loads without any authentication prompt or access denied error. This confirms the Broken Access Control vulnerability - the file lacks proper authentication and authorization checks.
The file displays the flag in UUID format. Copy it exactly as shown and submit it to complete the challenge.
This challenge demonstrates a critical security principle: security through obscurity does not work.
The developer attempted to "secure" the flag by:
anwvdzqtcucr)However, this approach failed because:
Choose how you want to get started
Choose a username to get started
We've sent a 9-character code to your email