Natas Level 6
Natas Level 6 — read the server-side logic the site exposes and follow it to a file that holds the secret, learning how sensitive includes leak.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Username: natas6
URL: http://natas6.natas.labs.overthewire.org
Study guide
Level map: sign in as natas6 and find the password for natas7.
What this level teaches
How reading source code shows you what the server compares your input against, and how that comparison value ends up exposed.
Key ideas
- Source disclosure. The page offers its own source code. A good habit is to read every offered source file in full.
- Include files. Applications often keep configuration or secrets in a separate file that is loaded by the main script.
- Reachable by URL. If that file lies inside the web root, anyone can request it directly.
How to approach it
- Open the source and ask: what does the code compare my input to, and where does that value come from?
- Fetch the referenced file by its path.
How developers prevent it
Store secrets outside the web root or in environment variables, and give server-side includes extensions that the web server will not serve as text.