The lab
here is how portswigger describes it
This lab contains a debug page that discloses sensitive information about the application. To solve the lab, obtain and submit the
SECRET_KEYenvironment variable.
there is a debug page left behind in the app that dumps its configuration, and it is not linked anywhere you would normally click, but a leftover html comment in the home page source points right at it. the page it points to is a phpinfo dump, which spills the whole environment including the SECRET_KEY we need. so the task is to read the source for the breadcrumb and then follow it to the debug page.
why this leaks#
debug pages and phpinfo output are developer conveniences, they print the full runtime environment so you can see what is configured. that is fine locally, but shipped to production it exposes environment variables, paths, and secrets to anyone who finds the url. here the url is not advertised in the ui, but it is sitting in an html comment in the page source, and comments are trivial to pull out with Burp. so the information is not really hidden, it is just not visible in the rendered page.
Step 1 - Find the hidden link in a comment#
with Burp running we browse to the home page. then in Target > Site Map we right-click the top-level entry for the lab and choose Engagement tools > Find comments. we see the home page contains an html comment with a link labelled "Debug", pointing at /cgi-bin/phpinfo.php.

Step 2 - open the debug page#
we open the page the comment points to:
/cgi-bin/phpinfo.php

Step 3 - read the SECRET_KEY#
the page reveals a pile of debugging information, including the SECRET_KEY environment variable. we copy its value.

Step 4 - submit the key#
we go back to the lab, click Submit solution, and enter the SECRET_KEY.

with this, the lab is solved!
