Security

Rogue files #2

Came across a couple of ‘extra’ files added to a client’s osC installation by XSS

ext/modules/payment/paypal/verify_ipn.php

This one contained a nice little virus package and is not to be confused with the genuine osC file that you may have on your site :

ext/modules/payment/paypal_ipn/verify_ipn.php

On the same site there was a file /images/ind.php that had been dropped in there – there should be nothing in the /images/ folder for osC other than images and possible a .htaccess file – worth having a look.

The images folder is easy for a hacker to drop a file into as the permissions on there may be set to 777 – you can try changing that to 755 which works on some hosting servers – but on others it seems to be that 777 is needed.

If you are set to 777 and a script file is placed into the images folder then you could try and stop it from running by using the .htaccess script listed here – like one contributor says on there it won’t stop the hack taking place but at least it will stop the blasted file from running.

‘edoced_46esab’ – whassat?

Another site flagged up by Google as being ‘dirty’ – on being asked to look through the files by the owner I could find only two ‘naughty’ files and  no database changes.

The file with the malware was (again) called ‘google1234568.php’ (where 1234568 is a random mix of characters) and was in the root folder. This is a non-standard osC file and the filename is an attempt to mimic a standard Google Web Tools verification file which will be called google1234568.html

The malware code in the file was encoded thus:

<?php $D=strrev('edoced_46esab');$s=gzinflate($D.....yadda....yadda...

Decompiling the code revealed a pile of php functions designed to search out various files (including windows, *nix and Mac password files; http.conf files, config.php etc etc) on the local disc and copy them. Sneakily the very first couple of lines were designed to return a 404 error to a number of bots including Google in an attempt to stop the bots from finding the malware code that followed.
This fake file still needs to be called from somewhere else the chances of it being visited by your average punter is virtually nil – running a file comp found that the only other suspicious file was cookie_usage.php and that one had been entirely substituted with code to call the fake google file.

The site was cleaned up and resubmitted to Google who cleared the malware flag.

You must secure an osC site properly – check out v2.3. Also try these:

osC Sitemonitor by Jack_mcs forum discussion here

osC Security Forum

Rogue files

Whilst running a file comparison between a good, local copy of a hacked osC site I found a number of poor,little orphan files on the server that, when examined, were full of nasty, ‘orrible code. Here’s a list of the little darlings which may help you:

In catalog folder

google ********.php (where ******* are random characters)
cookie_setup.php
jsys.php                 (a genuine file of this name may appear with Joomla)
reader.php

catalog/images

****.php – there should be no php files in the images folder

catalog/includes/classes

nusoap.php

In the admin folder (or whatever you have renamed it to. You have renamed it haven’t you?) These files are standard php/js files that have been placed on the server to assist the hacker in uploading/changing other files.

JsHttpRequest.php
utils.js

admin/incudes/classes/

nusoap.php

Also a .htaccess file has appeared in lots of directories where, previously, there was none. This new htaccess file is set to prevent directory browsing and just contains the line

Options All -Indexes

Changed Files

catalog/cookie_useage.php

catalog/includes/header.php  (base 64 code added after final ?> )

catalog/includes/languages/xxxxxx/cookie_useage.php

osCommerce Database Hack

Database hack

Recently I was working on a client’s website when I came across an interesting variation on the recent fake ‘Google’ files hack.

Looking at his database I found this in the Manufacturers table:

osCommerce Database Hack

(not the real filenames or manufacturers – names have been changed to protect the innocent :-) )

Quite nifty this one as, when the manufacturers’ details are called by the osCommerce PHP code it will output the google11367c8876898.php file code to the visitor’s web browser rather than an image – looking into the /images/ folder on the clients server – sure enough – there is a PHP file with the appropriate name just waiting to be called.