Tag: incident-response

  • What to do if your website is hacked

    What to do if your website is hacked

    Illustration of the first steps to contain, clean and secure a compromised website.

    Stay calm and act methodically

    Unexpected ads, a Google security warning, strange redirects or loss of administrator access are alarming — but panicking makes recovery harder. Breathe, gather information and follow a clear sequence: confirm the problem, preserve evidence, contain the attack, remove malicious code and then repair and harden the site.

    Quick reminder

    Don’t delete files or restore backups immediately. Early changes can destroy evidence that explains how the attacker got in — and without that you risk repeated compromises.

    The first checks: is it really a hack?

    Not every site problem is a hack. Before you commit to incident response, rule out common non‑malicious causes:

    • Domain expired or DNS misconfigured
    • Hosting outage or control panel problem
    • Expired or misconfigured SSL/TLS certificate
    • A buggy plugin or theme (especially after an automatic update)
    • Search engine warnings caused by outdated content or third‑party scripts

    Step 1 — Collect information and evidence

    Before you change anything, collect facts that will help you understand the scope of the incident and find the entry point:

    • Take screenshots of warnings, injected content and unexpected pages.
    • Check server and application logs (access logs, error logs, control panel logs).
    • Note which URLs are affected (homepage, specific pages, admin area).
    • Identify when the issue started and any recent changes (plugin installs, updates, new users, file uploads).

    Step 2 — Change all passwords and revoke sessions

    Assume credentials were exposed. Immediately change passwords for:

    • Hosting control panel (cPanel, Plesk, ISPmanager, etc.)
    • CMS administrator accounts (WordPress admins)
    • FTP/SFTP and SSH accounts
    • Database users (MySQL/PostgreSQL)
    • Any linked email accounts and third‑party integrations

    Where possible, revoke active sessions and API keys. Enable two‑factor authentication for accounts that support it.

    Step 3 — Make a full backup (preserve evidence)

    Make a complete snapshot of your site (files and database) before you delete anything. This preserves evidence for investigation and gives you a safe copy to inspect offline.

    Step 4 — Scan and inspect files and users

    Look for indicators of compromise:

    • New or recently modified files in web folders (suspicious PHP,.js,.php5,.phtml files)
    • Files with obfuscated or base64‑encoded code
    • Unknown administrator users in your CMS
    • Unexpected scheduled tasks (cron jobs) or persistent backdoors

    Step 5 — Find the entry point

    If you don’t identify how the attacker gained access, they may return.Common entry points are:

    • Outdated CMS core, plugins or themes (WordPress is a frequent target)
    • Compromised FTP/SSH or weak passwords
    • Vulnerable third‑party scripts or integrations
    • Unpatched server software or misconfigured permissions

    Step 6 — Contain and remove the malware

    Contain the damage, then remove malicious code carefully:

    1. Temporarily take the site offline or show a maintenance page if necessary.
    2. Replace infected core files with clean copies from an official source.
    3. Remove unknown plugins, themes and suspicious files — but keep your backup snapshot.
    4. Clean or rebuild modified templates and uploads; scan media folders for hidden scripts.
    5. Reset database users’ passwords and inspect tables for injected content.

    Step 7 — Restore from a known‑good backup if needed

    If the site is extensively damaged, restoring from a clean backup is often the safest route. Ensure the backup predates the compromise and that you patch the entry point before putting the restored site online.

    Step 8 — Patch, update and harden

    After recovery, close the doors the attacker used and reduce future risk:

    • Update CMS, plugins, themes and server software to the latest secure versions.
    • Harden file and folder permissions and disable unnecessary services.
    • Limit admin accounts and use strong, unique passwords plus two‑factor authentication.
    • Install a Web Application Firewall (WAF) or CDN with security features where appropriate.
    • Implement regular backups and test restores.

    Step 9 — Monitor and confirm clean operation

    After the site is live again, monitor logs, uptime and search engine warnings. Consider running malware scans for several days and verify there are no reoccurring modifications.

    When to call for professional help

    If the compromise is extensive, you cannot locate the entry point, or sensitive user data may have been exposed, get professional incident response. A security assessment can identify the root cause and recommend safe next steps.

    Need help investigating a compromise?

    Easy’s website security team can assist — they can help evaluate the incident, identify the entry point and suggest the safest way to recover. Request a Website Security Assessment.

    Conclusion

    The biggest mistake after a website compromise is restoring the site without identifying and fixing the root cause.Preserve evidence, change credentials, remove threats, then restore and harden your site. Regular updates, strong passwords, two‑factor authentication and tested backups are the best defenses against future incidents.