OpenCart Hack Recovery and Malware Removal
OpenCart recovery after a compromise
The store has started redirecting visitors to other sites, pages you never created have appeared in search results, the host has sent a warning, or the browser's own protection blocks access. These are typical signs of an infection, and every hour of downtime costs orders.
What to do right now
Do not delete anything "suspicious" at random — it is easy to remove working files along with the malicious code, and then the store stops working altogether. Do not change passwords before the entry point is established: if a backdoor is still in place, the new credentials will leak the same way. The most useful thing you can do yourself is take a copy of the site and database as they are, infection included — it will be needed for the investigation.
Order of work
- Evidence. A snapshot of files and database before any changes.
- The search. In OpenCart, malicious code most often hides in uploads, in the modification directory, in theme templates, and in the database itself — in settings and product descriptions.
- Identifying the entry point. The most common: pirated modules, an old PHP version with known vulnerabilities, a weak admin password, a vulnerable third-party module.
- Clean-up. Removing backdoors and restoring damaged files from a clean distribution of the matching version.
- Closing the hole. Otherwise the infection returns within days.
- Verification. The store works, there are no rogue redirects, and the code and database are clean.
After the clean-up
I lift the flag in the webmaster console if one was raised, and provide a list of what led to the compromise. The logical next steps are usually a security audit and configured backups — so that next time recovery takes an hour rather than a week.
If the site has been hacked more than once, or the infection returns after cleaning, that almost always means the hole was never found and only the symptoms were removed.