Overview
| Field | Value |
|---|---|
| URL | http://natas6.natas.labs.overthewire.org |
| Username | natas6 |
| Password | 0RoJwHdSKWFTYR5WuiAewauSuNaBXned |
Hints
Hint 1 — Where does the secret come from?
Hint 1 — Where does the secret come from?
Read the PHP source via the “View sourcecode” link. The script doesn’t define
$secret inline — it loads it from somewhere else using a PHP include. What file is being included, and what path is it at?Hint 2 — Can you access that file directly?
Hint 2 — Can you access that file directly?
The included file lives at
includes/secret.inc — a path relative to the web root. PHP processes .php files on the server, but .inc files may be served as plain text if the server isn’t configured to handle them. Try navigating directly to that URL in your browser.Solution
Full walkthrough
Full walkthrough
Include and config files must never be placed inside the web root. Store them above the document root, or configure the web server to deny access to
.inc files. If PHP can include it, a browser can fetch it.