How to Check Whether Your WordPress Website Has Been Reinfected After Malware Removal

How to Check Whether Your WordPress Website Has Been Reinfected After Malware Removal

The removal of malware from your WordPress website is not necessarily a guarantee that you have fully addressed the security issue because some malware infections will create backdoors or scripts for the attacker to use later on when gaining reentry into your site.

This is because the site might be found to be clean immediately after the removal of the malware, only for it to be re-infected days or weeks down the line. This is mostly due to the presence of a security loophole that has not been addressed or an active malicious file.

As such, it is imperative for site owners to conduct extra security scans after sanitizing the infected web site. Through scanning for any suspicious file alterations, unauthorized access, and abnormal activities on the web site, one will be able to tell if his/her WordPress site has been re-infected.

Understand the Signs of Malware Re-Infection in WordPress

Before carrying out further security tests, you must be aware of some of the indications of malware re-infection.

A possible indication of infection by malicious software would be the emergence of any strange redirects. This can be seen when people land up on different websites or gaming websites instead of their regular website. This is done by inserting malicious code in the website files.

Also, look out for the following warning signs:

  • Unknown Administrator account: This could be new users created on WordPress who have administrator privileges even without your consent.
  • Malicious files: Files that had been deleted before but now reappear.
  • Sudden changes on the website: Sudden appearances of spam pages or any other unfamiliar web links or changes in the existing website contents.
  • Unwanted resource utilization: Unwanted utilization of CPU and memory by your website because of any malicious code running in the background.
  • Frequent warnings: Warnings generated by the security plugins or Google Search Console regarding malware.

Nevertheless, these indications cannot necessarily prove that there is a re-infection. Some could be caused by normal plugin functionality or faulty configuration.

The following are the procedures that you can use to ascertain whether or not you have become reinfected.

Procedures for Checking if Your WordPress Site Has Been Reinfected

Having discovered certain potential red flags, the next thing to do is to inspect your website for signs of re-infection. These are the tests you should consider doing to help detect any malicious files or suspicious database actions that could be used for reinfection.

1. Perform Another Malware Test on Your WordPress Website

Start by performing another malware scan using a reputable WordPress security plugin. Tools such as Wordfence and Sucuri Security can help identify suspicious files, malicious code and other security problems.

Should you have previously installed a security plug-in to clean out malware, perform another scan to see if it finds anything new or residual. In particular, pay attention to files flagged as suspicious, unexpected PHP scripts and changes to important WordPress files.

Furthermore, use an external website scanner to examine your website from a visitor’s perspective. This may help detect malicious redirects and suspicious links and other such issues.

After the scan is completed, compare its results with those of the earlier security scans. This type of comparison will help you find any persistent threat or any file that has been found since cleaning.

However, bear in mind that no single scanning software can discover all infections. Hence, consider any successful scan to be one of the methods for confirmation, but not as a sign that everything is completely secure on your website.

2. Verify WordPress Core, Plugin and Theme File Integrity

Another important check involves examining whether attackers have modified your WordPress files without authorisation. The attacker can tamper with legitimate WordPress files so that they contain some hidden code that will be executed each time when you visit your website.

They can also manipulate the files of themes and plugins. WordPress core files may be verified with official checksums via the use of WP-CLI tool. You need to execute the following command in the directory where WordPress is installed:

  wp core verify-checksums

The above command checks the integrity of core files based on official WordPress checksums.

Nevertheless, the above instruction does not check all the plugins, themes, and custom files. In such a case, you have to check the same to spot the unknown changes. Look for any unusual codes or changes in the plugins and themes that are installed.

Moreover, you need to compare the dates when the files were modified with those when you updated the software. If you spot anything that appears unfamiliar, conduct an investigation first before restoring or replacing those files.

3. Check WordPress User Accounts and Database Entries for Unauthorised Changes

Attackers sometimes create hidden administrator accounts or modify existing user privileges to regain access to a WordPress website. Thus, checking your user accounts and database forms another critical step in the verification process.

Start by accessing your WordPress dashboard and going to Users > All Users. Check out the accounts and see if there are any strange users who have administrator privileges.

Focus on the accounts that are new, usernames that you are not familiar with, and users for whom there is no explanation for their registration. In case of detecting any unauthorized account, delete it after securing the site and gathering the data required for investigation.

Afterwards, examine your WordPress database using phpMyAdmin or some other database administration utility.

Ensure that you look for any unknown accounts and changes to privileges within the users and user meta data tables. In addition, check for any suspicious information or links that have been added to the tables of options and posts.

Remember that legitimate plugins and themes may create database entries. For this reason, investigate suspicious records before deleting them to avoid damaging your website.

4. Review Website Activity and Server Logs for Signs of Reinfection

Website activity and server logs can provide useful evidence of how an attacker may have regained access.

First of all, check your WordPress login activity, specifically those activities where there have been failures, IP addresses that are unfamiliar to you, and unexpected administrator activities. This may include multiple login attempts or even successful login to new, unauthorised locations.

You should also examine your hosting account’s access and error logs through cPanel or your hosting provider’s control panel.

Look for unusual requests to unfamiliar PHP files, repeated access to suspicious URLs, unexpected file uploads and requests that coincide with suspicious file modifications.

Moreover, if your host offers file change detection, then compare your change logs with those you made previously. This way, you will be able to see when the suspicious files were uploaded and, thus, how they came about.

5. Inspection of WordPress Directories and Configurations for Suspicious Changes

Aside from the core files, inspect other WordPress directories that might contain malicious scripts hidden by the hackers.

Start with the wp-content/uploads directory. WordPress normally stores uploaded images, documents and other media files here. But the presence of unknown PHP files or scripts in this folder needs to be examined since the hackers may exploit them.

The next folder to check is the wp-content/mu-plugins folder. As must-use plugins automatically load without showing up in the standard plugin management section, it is quite possible that any file here will go undetected by simple dashboard inspection.

You must also check any key configuration files, such as:

  • wp-config.php: Look for strange PHP code, strange inclusion of files or any database settings that have been modified.
  • .htaccess: Strange redirects, weird rewrite rules or unexpected access controls.
  • user.ini: Look for any odd PHP settings or automatic inclusion of files that might run malicious code.

Yet, be careful about deleting any files or configuration options which are unknown to you, because some may actually be part of legit plugin or hosting configuration. Instead, find out what they are supposed to do and whether they are malicious.

6. Check WordPress Cron Jobs and Server-Level Scheduled Tasks for any Signs of Malware Activity

It is common for some hackers to use server-level malicious scheduled tasks in order to reinstall any malicious software that has been deleted from the website. This explains why a website may become infected again shortly after a cleanup.

WordPress relies on WordPress relies on WP-Cron, a scheduling tool in it, to perform certain tasks, like publishing posts and updates. Attackers, however, may exploit the same for running malicious code periodically.

You can inspect scheduled WordPress events using a tool such as WP Crontrol. Look for any strange events or schedule of execution which have strange callbacks linked to dubious plugins.

Also, you should review the server level cron jobs from cPanel or SSH in case it is available in your hosting account. Look for any scheduled jobs executing any strange PHP scripts from different directories.

In case you find any such suspicious scheduled task, you need to know the file or process running it before deleting it; otherwise, just deleting the scheduled task won’t be able to stop the malware from coming back.

7. Check Google Search Console for Malware and Security Warnings

Google Search Console provides another way to check whether Google has detected security problems affecting your website.

Log in to your Search Console account and open the Security Issues report. Check whether Google has identified malware, deceptive pages, harmful downloads or other security problems.

When a warning message reappears after removing malware, find out what is wrong with the pages and files rather than requesting another assessment. The warning may indicate that malicious content remains or that attackers have compromised the website again.

Once you have confirmed that the reported problems have been resolved, you can request a security review through Search Console.

Meanwhile, a clean security issue report doesn’t necessarily imply that your website is free of malware. Google may not detect every infection. This check should, therefore, be combined with others such as malware scans.

Monitor Your WordPress Website After Verification

After completing the security checks, do not assume that your website will remain safe without further attention. Rather than that, continue with monitoring for any unusual activity before they become a cause for the next security incident.

1. Enable File Integrity Monitoring and Security Alerts

Use a security plugin or monitoring service that tracks important WordPress file changes. Setup alerts so that you are notified of any unusual changes, especially to core files, plugins, themes, and configuration files. In such a way, you will be able to examine any suspicious changes before the attackers exploit them to infiltrate your website once more.

2. Schedule Regular Malware Scans

Do not depend only on one scan after cleaning up from malware. Instead, configure regular malware scans to identify suspicious files, malicious scripts and other security problems that may appear later. Moreover, one should analyze the reports generated from these scans and not ignore the recurring alerts.

3. Keep WordPress, Plugins and Themes Updated

Outdated WordPress installations, plugins and themes may contain vulnerabilities that attackers can exploit to regain access. Install patches for security immediately and remove any plugins or themes which are not being used. Also, you have to get your extensions from credible sources and avoid installation of tampered ones. 

4. Password Change and Two-Factor Authentication

When you experience the attack via compromising of login credentials, it is highly necessary to change your password. WordPress administrator, hosting control panel, FTP/SFTP and database user accounts passwords should be updated whenever there is need.

Furthermore, use strong, unique passwords and enable two-factor authentication to provide additional protection against unauthorised access.

5. Keep Clean Backups Updated

Lastly, make sure you have updated backups for all of your WordPress files and the database. This should be done in such a way that the backups are stored safely and are clean before the infection. However, you should not just think that all backups will be safe enough for restoration.

Before you use any backup, make sure that there is no malware in it. You should also check from time to time whether you can restore your backups successfully because you will have one more solution in case your website gets affected by some malware again.

Conclusion

Checking whether your WordPress website has been reinfected after malware removal requires more than running another security scan. You need to examine important website files, configuration settings, database records, user accounts, scheduled tasks and server activity to identify possible signs of another compromise.

Additionally, proper security monitoring, updates, good login security, and backups will ensure future prevention from such attacks. The most important thing is to find out what caused the initial security vulnerability that enabled the malware to penetrate into your site.

If you want to protect your website against recurring security problems, choosing reliable WordPress hosting is an important step.

HarmonWeb provides dependable hosting solutions designed to support website performance, stability and security. Explore our hosting plans today and give your WordPress website a more reliable hosting environment.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply