Skip to main content

What to Do If Your Website Is Hacked: First Steps

November 26, 2026 5 min read
Laptop on a desk in front of server racks.

If you are asking what to do if your website is hacked, start by containing the problem, not by deleting suspicious files. A redirect that appears only on mobile devices or for visitors arriving from search can still indicate compromise. Move in a deliberate order: limit harm, preserve evidence, investigate the scope, remove the cause, and restore service from a clean source.

If you do not have someone responsible for the website or Linux host, contact your hosting provider or a qualified incident-response professional. Avoid making changes that could destroy evidence or spread the problem to backups and connected systems.

First: Contain the incident without destroying evidence

If visitors are being sent to an unsafe or unrelated site, treat the website as compromised until you have a reasonable explanation. Ask your hosting provider or technical responder to help restrict access. Depending on the situation, that may mean putting up a temporary maintenance page, limiting traffic, or isolating the affected host from other systems.

Do not automatically power off a Linux server. A responder may need to inspect its current state, and shutting it down can interrupt evidence collection. Isolation is different from shutdown: a qualified person can limit the server’s network access while preserving its state where practical. If the site is actively harming visitors and you cannot get prompt help, prioritize stopping public access, then document what you did and when.

Tell staff not to log in to the affected site or use its admin tools until you know they are safe. If the site accepts payments, handles customer accounts, or connects to other business systems, alert the people responsible for those systems so they can check for related risk.

Notebook and network device arranged beside a server cabinet.

Preserve evidence before cleanup

Before anyone removes files, changes configurations, or restores a backup, preserve what may help explain how the compromise happened. Ask your host or responder to save available copies of:

  • Web-server access and error logs, plus relevant system and authentication logs.
  • CMS, plugin, theme, and application logs, if available.
  • DNS, CDN, firewall, and hosting-control-panel activity records.
  • Current website files and the database, stored separately from production and clearly marked as potentially compromised.
  • Relevant server configuration, scheduled tasks, system accounts, and access-key details.

Record when the redirect was first noticed, which pages or visitors it affected, and any changes made since then. Preserve original copies where possible and note the time zone used in logs. The CISA incident response playbooks provide a broader framework for coordinating containment, investigation, and recovery.

Work out whether the redirect is malicious

Test the issue carefully using a clean device and network. Check the page by entering its address directly, then compare what happens when arriving from a search result. If you can do so safely, compare behavior on mobile and desktop. A redirect that appears only for certain visitors is not proof of malware, but it should not be dismissed as harmless just because it is inconsistent.

Some redirects can come from a third-party ad, analytics tool, embedded widget, or other external script. To distinguish that from a site or server compromise, have a technical responder review the site’s own files and settings as well as the external services it loads. Check whether the behavior follows a particular script, page, browser condition, or traffic source. Google’s guidance on preventing malware infections also describes warning signs and ways to investigate suspicious site behavior.

For a Linux web server, the review should go beyond the visible page. Ask the responder to inspect web-server configuration and document roots, CMS core and extension files, scheduled tasks, system accounts, SSH access, keys and secrets, and any recent file changes. Check DNS, hosting, and CDN accounts too. A clean-looking homepage does not establish that the rest of the host or its management accounts are safe.

Secure accounts and identify the entry point

From a device you believe is clean, change credentials for the website administrator, hosting account, domain registrar, DNS and CDN services, database, SSH or SFTP access, and any email account used for password recovery. Revoke old sessions and rotate exposed keys, tokens, and application secrets. Enable multifactor authentication where available, and remove accounts that no longer need access.

Do not stop at changing passwords. The responder should look for the weakness that allowed access, such as a vulnerable or altered application component, a compromised account, an exposed key, or an unsafe configuration. Review connected sites and services that share hosting, credentials, or administration. If you cannot establish the scope, treat connected systems and backups as potentially affected until checked.

For ongoing Linux operations, a review of Linux and server management can help frame the areas that need attention beyond the website itself.

Clean the cause, then restore service

Removing a suspicious redirect alone may not fix the compromise. Malicious code can be placed in more than one file or configuration, and an attacker may retain access through an account, scheduled task, or stolen key. Have the responder remove the underlying access and correct the weakness before putting the site back into normal use.

A backup can be a useful recovery source, but only if it is believed to be clean and the weakness that led to the compromise has been addressed. Confirm when the backup was made and whether the suspicious behavior or unauthorized access could already have been present. Restore in a controlled way, then check the site, database, server configuration, accounts, and connected services before reopening it to visitors. For planning a broader recovery sequence, see this guide to testing business backup restores.

After service returns, monitor the site and its logs for the same redirect, new files, unusual account activity, and unexpected configuration changes. Check the affected pages from different devices and traffic paths. Keep a record of the incident, the evidence saved, the changes made, and who approved reopening the site.

Decide whether people need to be notified

A redirect does not by itself prove that customer information was accessed, but it also cannot rule that out. Ask the response team to determine what information the site collected, what systems and records were reachable, and whether there is evidence of access or exposure.

If the site handles health, financial, legal, student, or other sensitive personal information, preserve evidence and promptly involve the organization’s privacy or security lead and qualified legal counsel. Notification duties depend on the facts and applicable requirements. Florida organizations can review Florida Statutes section 501.171 with counsel; do not rely on a web symptom alone to decide whether notification is required.

Conclusion

Contain first, preserve evidence, check the full Linux and account environment, and restore only after the cause is addressed. If your business needs help with Linux managed services or website management and security, Zevonix provides technology services to businesses in Daytona and Volusia County. Call (386) 260-0777 to discuss the incident and next steps.

Ready to Strengthen Your IT?

Let Zevonix handle your technology so you can focus on what matters most — your business.

Schedule a Free IT Assessment