osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Website Hacked - Possible Security Breech

This is a discussion on Website Hacked - Possible Security Breech within the osCommerce 2.2 Discussion forums, part of the osCommerce 2.2 Forums category; Hi All, Having used OSC ms2.2 and OSCMax for a number of years across a number of different websites, ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 10-08-2007, 06:42 AM
Lurker
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
robp is on a distinguished road
Default Website Hacked - Possible Security Breech

Hi All,

Having used OSC ms2.2 and OSCMax for a number of years across a number of different websites, i had a bit of a shock this morning, when i received a phone call from a client claiming that one of their customers had complained about having to fill out their credit card details twice; once on the website and once through protx. Upon investigation it became apparent that one of my worst fears was happening and that this site had been seriously hacked, and a fake "Payment Form" has now been inserted into the checkout_confirmation.php screen.

I have posted this to the OSC forums, but such is my concern over security breeches that i'm posting it to this community too.

I've found a number of files have appeared on the server within the catalog/images folder:

cvv.html
yzx.txt
two image files for mastercard and amex

Additionally, the following files within catalog/ have all been modified with different upload dates according to my ftp client:

index.php
create_account.php
login.php
tell_a_friend.php

Each modified file contains the following:

// da edit xong

The login file contains this code at line 26:

$password123 = $password;
session_unregister("password123");
session_register("password123");
// da edit xong

Create account Contains around line 55:

$password123 = $password;
session_unregister("password123");
session_register("password123");
// da edit xong

The index file contains:

$td_query = tep_db_query("UPDATE `configuration` SET `configuration_value` = 'true' where `configuration_key` = 'ACCOUNT_DOB'");

at the bottom of the file.

Tell a Friend

The Tell a Friend file however is of most concern as this file has been modified to allow the hacker to upload other modified files.

My belief is that the tell a friend file was the first to be modified and then the hackers use this file to do their work, via uploading the other files.

Additionally i have subsequently established that the checkout_confirmation.php page has also been hacked, however the date has not been altered since the original upload when the site was moved to its new server earlier this year.

This file has been modifed to run an sql query to extract the customers (based on their customer_id) information, ie name, address, date of birth, telephone and email to be emailed to a gmail account, along with the credit card details that have been posted on the "Fake Payment" form.

--

As far as i can ascertain no other files have been modified / hacked.

We have in the past few hours been able to rule out a security breech from malware / spyware / keyword loggers etc, and the server company have also ruled out a security breech.

I am still investigating how the fake payment form has been added into the checkout page, however i have now deleted the entire shop from the server pending further investigation.

If anybody has experienced this before and knows if there is a security breech or "hole" within OSC ie a file or folder that could potentially be a security risk, then if they could let me know so i can close it all up - as this site is on a dedicated server all folders are set to 755 including the images folder and all config files are set to 444.

Regards,

Rob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-08-2007, 12:35 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,190
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Website Hacked - Possible Security Breech

I have seen this happen before, but it was not a hole in osC that caused the problem at that time, it was a hole in another script (phpBB2) that allowed the attacker a method of opening a backdoor on the server to modify the osC files.

If you are on a shared server that runs any other web scripts like phpbb, joomla, smarty, etc, and the person running the site has not properly secured it, it is very easy for someone to upload a file to the server and execute it. There are automated bots that do nothing but search for these holes.

mod_security can go a long way to blocking access to the common vulnerabilities, and if your server is not running it, I highly suggest you get it installed and running with a good rule set.

Without looking through the server logs, there really is no way to tell how they got in really. So I suggest you get a hold of the logs or persist in getting your host to find the specific vector used to get in.
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-09-2007, 01:01 AM
Lurker
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
robp is on a distinguished road
Default Re: Website Hacked - Possible Security Breech

Hi,

Thanks for the reply. This site is actually on my new dedicated server and is one of only 4 sites on there, all of which currently run OSC yet is the only one affected.

I was speaking with one of the OSC modorators yesterday via PM and he mentioned that it was probably the normal "hole" within the images folder due to that folder having 777 permissions.

The problem is this server doesn't permit 777 permissions on any folder, so all folders (inclding images) were running at 755 with files at 644 except for the config files at 444. The site was shifted to it current location 3 months ago, but there was no sign of this until september, so some how they've managed to hack into a site with no obvious holes in it.

I've spoken with the server tech people and they are saying the server is totally secure, so i'm really stummped as to how they managed to get in. If i knew that then at least it would make me feel a touch better!

I'm actually going through all of the OSC updates to double check that i'm running all of the latest patches, i'm part way through and so far have only found one i'm missing and that was a spelling mistake in a word.

If i do ever establish how this occured then i'll post back to the forum as if i can prevent it happening to somebody else then it needs to be done.

Regards,

Rob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 10-09-2007, 01:13 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 256
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Website Hacked - Possible Security Breech

Quote:
Originally Posted by robp View Post
I've spoken with the server tech people and they are saying the server is totally secure, so i'm really stummped as to how they managed to get in. If i knew that then at least it would make me feel a touch better!

Yeah, all servers are always totally secure (until proved otherwise).

I would surely would be very troubled until I was able to find out what happened and how they got in...
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 10-09-2007, 01:25 AM
Lurker
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
robp is on a distinguished road
Default Re: Website Hacked - Possible Security Breech

thats exactly what i said to the server company ... who incidently blamed the software for security holes - its just a bit strange that this particular site has been running for nearly 3 years on a shared server without any sign of a problem, then it was shifted to the new server as they were outgrowing the shared space - 3 months later hacked to pieces!!

I've had all of the PC's and MAC's in the office scanned for malware etc, i've had the clients IT people scan their systems in case somebody was able to get usernames and passwords from our systems and then access via ftp, but they've all come back clean.

it really is so annoying!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 10-09-2007, 11:49 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,190
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Website Hacked - Possible Security Breech

If you are on a dedicated box, make sure you have the following installed and configured:

1. Hardware of software firewall
2. mod_security with a good rule set - Really important to close the most widely known exploits.
3. Disable direct root login (force SU) or use a keypair instead of password
4. Disable telnet
5. Disable anonymous ftp
6. Make sure all your server software is up to date - OS, control panel, kernel, rpm's, etc.


Next, your host is probably correct. The 'hacker' most likely took advantage of a hole in one of many scripts on the server. This is always the easiest way in.

If you are using an older version of osCommerce, there are many, many of these holes. Update asap.

If your dedicated box is not running mod_security,that is most likely the reason you have not had issues until now. Most hosts run it on their apache based shared servers. When you move to a dedicated solution, security responsibility switched to you instead of a hosts security team.

Next, hackers rarely target really small sites. So as your site has grown, it has become a more appealing target. If your server is not properly stealthed, it is advertising itself to port scanners and telling hackers 'look at me, I am not properly firewalled!'

To a hacker, that means an easy target.

Since you are running your own server, you have access to all the logs, so start looking
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
login page for admin section has been hacked :-( amilo osCMax v1.7 Discussion 0 05-24-2007 12:50 PM
777 permission files and folders hacked trap osCMax v2 Installation issues 1 01-17-2006 07:18 AM
Call for Mods : Have you hacked in a mod to your shop? michael_s osCMax v1.7 General Mods Discussion 14 06-02-2005 10:08 PM
Quantity Tracking Pro - anyone hacked this into MS2 MAX ? malcol27 osCMax v1.7 General Mods Discussion 0 02-20-2005 08:10 AM
which add-on under this website? laonux osCommerce 2.2 Modification Help 1 08-26-2003 08:34 PM


All times are GMT -8. The time now is 03:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax