my Magento Admin website was hacked and show me a file manager hacked page with an option to upload file, change permissions, delete, rename, etc like the picture:

Hacked admin page

I tried to change the URL path on database, local.xml, .htaccess and really change but ever show me the file manager hacked page.

The .htaccess contain this code and I renamed the file cause if I don't the website doesn't work:

RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]

Either, the home page is ok but when I try to access any product or another page show me the 404 error. I tried fixed it changing the web/secure/base_url and web/insecure/base_url with "mydomain.com/index.php/" but all the website stay damaged and without CSS.

Looking the database, the field admin/url/custom don't exist (only "use_custom" and "use_custom_path").

It's ok?

Anybody can help me to fix it, please?

Update Jan 26, 2016: I changed the CAPTCHA row to 0 in the database and now is working the Admin. Either, I changed the Admin URL to protect the access and enable some IPs to access this area. Now, I'm trying to remove the malware.

  • 3
    I would encourage you to enlist the help of a professional whom can help recover your site and remove vulnerabilities. There has been numerous security releases recently. Jan 15, 2016 at 17:33

4 Answers 4


Take the site offline immediately and then start investigating the PHP code and other files.

See also: What should you do with the hacked installation?


Fabian's answer is solid, at least as far as a technically focused response should be handled. That said, 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 Fabian's 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 here on Magento Stack Exchange and 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:

    • The specific Magento version you are running
    • The laws covering Data Breaches, Privacy Protections, and Customer Notification Requirements that govern Merchants operating in and/or located in your geographical region.
    • 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:

  1. What should you do with the hacked installation? - related question here on Magento Stack Exchange.
  2. Visa Data Security Resources for Small Businesses
  3. MasterCard Rules and Compliance Programs for Processors & Merchants
  4. American Express US Merchant Security Policies
  5. Discover Card Fraud & Security Resources for Merchants
  6. Experian Data Breach and Notification Resources

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.

  • 1
    Great writeup and important additions, thanks! Feb 23, 2016 at 8:13
  • Thanks for the feedback, Fabian - that's high praise coming from you sir! Feb 23, 2016 at 8:13

To restore proper functionality, you will need to secure your server (please pay a professional to get it done properly) and then restore a file backup from before your site was hacked. You might also try working with your hosting company to find out how it was hacked and prevent this from happening in the future.


Login your admin and go to system->Design->go to "HTML Head" remove "Miscellaneous Scripts" if added by any third party.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.