PortSwigger Academy Lab: Information disclosure on debug page
该文章描述了一个实验室环境中的漏洞利用过程:通过访问调试页面和使用Burp Suite发现隐藏的cgi-bin目录下的phpinfo.php文件,并从中提取出SECRET_KEY环境变量作为解决方案。 2025-12-30 08:45:9 Author: infosecwriteups.com(查看原文) 阅读量:4 收藏

VISCID

Description: This lab contains a debug page that discloses sensitive information about the application. To solve the lab, obtain and submit the SECRET_KEY environment variable.

Upon accessing the lab, we have a shopping website present:

Press enter or click to view image in full size

On clicking throuhgh view details for productId and going back and even checking through the Network Tab in chrome devtools, nothing interesting really popped up:

Press enter or click to view image in full size

Even when changing productId to non-integers, the response was:

"Invalid product ID"

Next, I decided to use burp suite:

I opened Burp Suite CE -> Start Temporary Task -> Turn intercept off in proxy tab

Get VISCID’s stories in your inbox

Join Medium for free to get updates from this writer.

After all this, I repeated the actions of going to the lab website and clicking a product.

This time, when checking the site map in Target tab, it showed this:

Press enter or click to view image in full size

The cgi-bin detected by the Burp Suite CE is an interesting directory since the /cgi-bin/ directory is a directory where a web developer would put executable files in to make their website have more features than just plain HTML (Locust377).

In our case, it might mean that it has extra features like debug page.

In cgi-bin directory, the detected page is https://0a34000504f0107984aad1a000ea00ce.web-security-academy.net/cgi-bin/phpinfo.php

Press enter or click to view image in full size

According to php.net, phpinfo.php includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.

Using CTRL+F, we can find SECRET_KEY which will be the lab solution.

IMPORTANT: This phpinfo.php is important as it can often tell what outdated / old software is being run on the website, which can allow them to use relevant Public CVEs against the website. Additionally, the phpinfo.php contains lots of information about different directories including internal ones which could assist hackers in causing harm by exploiting path traversal attacks or other vulnerabilities if present.


文章来源: https://infosecwriteups.com/portswigger-academy-lab-information-disclosure-on-debug-page-f4e5c142f1ce?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh