Phpinfo Vulnerability Introduction The PHPinfo vulnerability is a critical security flaw that allows attackers to retrieve sensitive information about a website's server configuration, including PHP version, server software, and installed extensions. This information can be used to exploit other vulnerabilities or launch targeted attacks. Technical Details The vulnerability is caused by a lack of proper input validation in the PHPinfo() function. When called without any arguments, PHPinfo() displays a detailed report containing various server and configuration information. Attackers can exploit this by crafting a malicious request that triggers the PHPinfo() function and captures the output Impact The impact of the PHPinfo vulnerability can be severe, as it can lead to: Information disclosure: Attackers can obtain sensitive information about the server, such as PHP version, server software, and installed extensions. Exploitation of other vulnerabilities:The information gathered from PHPinfo() can be used to identify and exploit other vulnerabilities on the server. Targeted attacks: Attackers can use the information to launch targeted attacks against the website or its users. Full Poc After doing little recon. Using recon-ng (tool in kali linux), and gobuster(ethire) we will find the hidden file phpinfo for the website : And this is the page : https://alshaab.edu.iq/phpinfo.php and this is a screenshots for the operation: Mitigation To mitigate the PHPinfo vulnerability, website administrators should: Disable PHPinfo(): The simplest and most effective way to prevent the vulnerability is to disable the PHPinfo() function. This can be done by adding the following line to the .htaccess file: ``` php_flag display_errors off ``` Restrict access: If disabling PHPinfo() is not possible, website administrators can restrict access to the function by using authentication or IP-based filtering. Use a firewall: A firewall can be used to block malicious requests that attempt to trigger the PHPinfo() function. Keep software up to date: Regularly updating PHP and other server software can patch vulnerabilities and reduce the risk of exploitation. Conclusion The PHPinfo vulnerability is a serious security flaw that can have severe consequences. Website administrators should take immediate steps to mitigate the vulnerability by disabling PHPinfo() or implementing other protective measures. By following these recommendations, websites can reduce the risk of information disclosure, exploitation, and targeted attacks. MUHAMMAD MUSTAFA HUSIEN