Website keeps getting hacked after malware cleanup: causes to check next
By Daniel Brooks Updated 10 min read
On this page (12 sections)
- The short version
- Why your website keeps getting hacked after malware cleanup
- Preserve evidence before changing the site
- Find the access route before cleanup
- Check backups before restoring them
- Verify files against trusted copies
- Review hidden accounts and database users
- Patch software and remove unused components
- Reset every credential connected to the site
- Check server settings and decide when to escalate
- Use documented security guidance
- Questions people still ask
In short: Your website keeps getting hacked after malware cleanup because an access route remains open. Malware removal can delete malicious files without fixing vulnerable software, stolen credentials, altered accounts or unsafe server settings. Treat cleanup as the start of the investigation.
Part of our guide on secure hacked google account
A clean scan does not prove the door is locked. Check the door, the keys and the people who still have access.
| Reinfection timing | Measure it from access logs; rapid return suggests an unresolved access route |
|---|---|
| Backup risk | Snapshots created after compromise can contain the infection |
| Common entry points | Outdated software, stolen credentials, unsafe permissions and exposed services |
| Account review | Compare every privileged account with your own records |
| Credential response | Reset each affected service separately, then revoke old sessions and tokens |
The short version
- Isolate the site, preserve evidence and create a known-good backup before making major changes
- Review hosting, CMS, database, FTP, SSH, email and API access after the breach
- Replace outdated or abandoned software, including inactive plugins and themes
- Check backups before restoring them, because older snapshots can contain the same infection
- Monitor file changes, logins and new accounts after the repair
Why your website keeps getting hacked after malware cleanup
A scan can find infected files and remove them successfully. The same malware can return if an outdated plugin, stolen password or hidden access method remains active.
Scan results show what the tool identified, not how the attacker entered. Review web-server logs, CMS activity, file changes and hosting records together.
Use the vendor advisory, National Vulnerability Database or WPScan records to confirm a named software flaw. Do not guess from a version number alone.
Rapid reinfection points to remaining credentials, an active backdoor or a compromised deployment process. Preserve evidence before changing the server. There is more on scam pop up repeats after closing in a separate guide.
Preserve evidence before changing the site
Take the site offline or restrict it to a maintenance page if attackers still have access, customer data is exposed or harmful redirects remain. Tell your host before deleting files.
Copy the web root, database export, server configuration, scheduled tasks, CMS audit logs, access logs and error logs. Include authentication, firewall, FTP, SSH and hosting-panel logs when available.
For Apache, check /var/log/apache2/access.log and /var/log/apache2/error.log, or /var/log/httpd/access_log and /var/log/httpd/error_log. Nginx commonly uses /var/log/nginx/access.log and /var/log/nginx/error.log. If that sounds like your situation, read up on hotmail email spoofed sender keeps sending after password change next.
Windows hosting commonly stores IIS logs under C:\inetpub\logs\LogFiles\W3SVC*; check Event Viewer and the host's control panel for application and security logs. WordPress audit plugins often call their files activity or audit logs, including WP Activity Log and Simple History.
- Copy files and logs without editing the originals, using read-only storage where possible.
- Export the database in SQL format, and retain the original compressed backup if the host supplies one.
- Name each item with UTC time, such as
2025-03-08T14-30Z-nginx-access.log. Record the server timezone. - Create SHA-256 hashes with
sha256sum filenameon Linux orGet-FileHash filename -Algorithm SHA256in PowerShell. - Store a copy offline or in a separate account with limited access. Never keep the only evidence on the compromised server.
Find the access route before cleanup
Match suspicious file times with access-log requests, successful logins, password resets, account creation and deployment events. Check UTC offsets before comparing timestamps.
Look for POST requests to login, upload, XML-RPC, administrator and unfamiliar PHP paths. A single request does not prove compromise, so compare it with file and account changes. People in this spot often ask about dns poisoning vs dns hijacking after router reset as well.
If the host is managed and does not provide these logs, ask support in writing within 24 hours. Request retention periods, source IPs, authentication events and a copy of relevant records.
Use a clean workstation for administration. Do not open suspicious scripts or restore the live site while the timeline remains unclear.
Check backups before restoring them
A backup is useful only when you know when it was created and whether the site was already compromised. Restoring an infected snapshot can place the same web shell or altered plugin back on the server. For the detail, see our notes on Windows 10 rootkit tools.
List every snapshot date, source and retention status. Copy candidates to a separate location, scan the files and database, and test them in isolated staging.
Compare core files with fresh vendor downloads. Inspect upload, cache and image directories, but do not label every unfamiliar file as malicious.
Ask your host about older or separate backups when the visible rotation has no clean copy. It helps to understand contacting bank fraud line before going further.
- Preserve the current files, database and access logs before restoring anything.
- Test candidate backups in isolated staging, never on the live site.
- Compare files and database content with clean installations and known-good records.
- Restore only after credentials, software and server settings have been reviewed.
- Record the snapshot date, source and test result in the incident file.
Verify files against trusted copies
Use vendor packages as your baseline for CMS core files, plugins and themes. A checksum proves a file matches the copy you downloaded, not that the download itself is trustworthy.
Download from the official vendor over HTTPS, record its release version, then run sha256sum package.zip. Compare a published checksum when the vendor provides one.
For a controlled snapshot, run tar --xattrs --acls -czf site-2025-03-08T1430Z.tar.gz public_html and sha256sum site-2025-03-08T1430Z.tar.gz. Avoid running archive commands while attackers still control the account.
On a clean staging copy, compare files with diff -qr clean-site/ live-copy/. Review every difference before replacing it. Do not overwrite evidence or production files during this check.
Review hidden accounts and database users
Attackers can create privileged CMS accounts or raise an existing user's role. Review CMS users, hosting-panel accounts, FTP or SFTP users, SSH keys, database users and deployment tools.
For WordPress, inspect the configured table prefix before running a read-only query. A typical review is SELECT ID, user_login, user_email, user_registered FROM yourprefix_users ORDER BY user_registered DESC;.
Use yourprefix_ only as a placeholder, and verify the database name and backup first. Run the query with a read-only database account where possible.
Do not delete accounts or edit privilege rows directly without a tested backup and staging copy. Use the CMS interface when possible, then confirm its audit log and database agree.
- Privileged accounts with no known owner or business purpose
- New users whose creation date matches suspicious logins or file changes
- Existing accounts whose roles changed without an approved request
- Unknown FTP, SSH, database, API or deployment credentials
- Forwarding rules and recovery addresses you did not configure
Patch software and remove unused components
Update the CMS, plugins, themes, server packages and runtime after collecting evidence. Test changes on staging first, especially during an active incident.
Inactive plugins and themes can still contain executable code. Remove software you do not need, then replace abandoned projects with maintained alternatives.
Use vendor advisories, patch notes, CVE records or WPScan entries when assessing a named vulnerability. Do not infer exploitability from age alone.
A current version reduces one class of risk, but it does not remove stolen credentials or malicious changes already present. Review the site after updating.
| Status | Risk question | Action |
|---|---|---|
| Security update available | Does the advisory affect your installed version? | Test and apply the patch promptly |
| No recent maintenance | Is the project still supported? | Check the vendor record and replace it if support has ended |
| Inactive software | Can the server still execute its files? | Remove it after preserving evidence if needed |
| Unknown source or altered files | Can you verify the package? | Replace it with a clean vendor download |
| Current software | Are credentials and settings sound? | Continue the access and log review |
Reset every credential connected to the site
Reset credentials for every affected service, including CMS administrators, hosting panels, FTP, SFTP, SSH, databases, email, deployment systems and APIs.
Use unique passwords, multi-factor authentication and a password manager. Revoke sessions, SSH keys, application passwords and API tokens rather than changing only the visible password.
Update configuration files after creating a protected backup and testing the new database credential. Check email forwarding and recovery settings because attackers use them to regain access.
- CMS and hosting accounts: reset passwords, revoke sessions and enable multi-factor authentication
- FTP, SFTP and SSH: remove unknown users and keys, then issue new credentials
- Database accounts: change credentials and update the application configuration safely
- Email accounts: reset passwords and inspect forwarding, filters and recovery settings
- APIs and integrations: revoke old tokens and create replacements with limited permissions
Check server settings and decide when to escalate
Review file ownership, permissions, server rules, scheduled tasks, firewall settings and exposed services with your host or administrator. Do not apply permission values blindly.
Inspect .htaccess, Nginx configuration, scheduled tasks and deployment scripts for redirects, unexpected handlers or commands. Compare them with a known-good copy.
Escalate to incident response and take the site offline when you cannot identify the entry point, privileged access remains unexplained, customer data may be exposed, the attacker is active, or reinfection follows credential resets and patching.
Escalate within 24 hours when managed hosting cannot provide logs, isolation or a clean restore point. Keep the original server available for evidence instead of deleting it.
- Capture current files, databases and configuration before changing settings.
- Ask the host to confirm ownership, permissions, firewall rules and isolation options.
- Restrict public access if active compromise, data exposure or harmful redirects continue.
- Use staging for rebuilds and test directory listing, login limits and application routes.
- Keep a dated change record and review logs after every deployment.
Use documented security guidance
Use CISA's Incident Response Guide at cisa.gov/resources-tools/resources/incident-response-guide, especially its preparation, containment, eradication and recovery practices.
Use NIST SP 800-61 Rev. 2 at csrc.nist.gov/pubs/sp/800/61/r2/final for incident handling and evidence considerations. NIST SP 800-86 covers integrating forensic techniques into incident response.
Check the National Vulnerability Database at nvd.nist.gov, vendor security advisories and WPScan's vulnerability database at wpscan.com. These sources support version and vulnerability checks, not a substitute for log evidence.
Questions people still ask
How long should I monitor after cleanup?
Set the period from your logs, exposure and business risk. Review login, file and account alerts daily during the early recovery period, then continue at a lower frequency.
Can a malware scanner miss an infection?
Yes. Scanners can miss obfuscated code, database changes, scheduled tasks, stolen credentials and server-level access. Pair scanning with file comparison, account review and log analysis.
Do I need to rebuild the site after repeated hacks?
Consider rebuilding when you cannot establish file integrity, trust the server or identify the access route. Preserve evidence, export the database and rebuild in isolated staging with trusted software.
Should I pay for professional malware removal?
Use a specialist when reinfection continues, logs are missing, the server is shared or business data may be involved. Costs depend on scope, urgency and whether rebuilding is required; request written quotes and a defined scope.
Can switching hosts stop repeated hacks?
A move can help when the provider lacks patching, isolation or logging. It will not fix vulnerable code or stolen credentials. Verify the site and rotate access before migration.