Wordfence was blocking all visitors and my email was full of blocking emails. It was supposed to block when a visitor or hacker only tries to find non-existent PHP or script pages to exploit vulnerable codes and pages and inject malware/virus.
inbox was full of IP-blocking messages
But due to a cache problem a lot of CSS files were missing, it was a plugin error of the cache plugin. So when any visitor was visiting the site a large number of CSS scrips was not found automatically therefore wordfence blocked the visitors.
Let’s share screenshots from my PC to walk you through the process of how I found the issue and solved it:
Step:2
I checked the Wordfence dashboard and found CSS files missing problem led to all IP blocking.
Step 3:
I visited the website Dakhm.com and found many missing 404 CSS files due to cache problems.
Step 4:
Then I tried to visit another page of the website, but now Wordfence blocked my IP too like other IPs.
Step 5:
In this step, I need to unblock myself and login to the website to remove my IP from Wordfence block list. I will be using Filezilla for FTP to change Wordfence plugin’s folder name so that Wordfence plugin is deactivated. In this way, my ip will be unblocked as the plugin itself is deactivated.
Step 6:
I could log in after deactivating the Wordfence plugin.
Step 6:
Follow the screenshot below to clear the cache from the wp optimize cache plugin.
Step 7:
Then go to Cloudways as per the below screenshot, and clear Varnish cache from your server.
Step 8:
Then go to Cloudflare as per the below screenshot, and clear Everything.
After clearing all cache I saw there was no missing css files, from chrome inspect element.
Then change Wordfence plugin’s folder to real name with FTP and login to website and activate the plugin, then go to the blocking option and unblock necessary ips, like below screenshot. And you are done.
Share this article if it helps.
If you need help regarding any WordPress/website issues, you can contact me.
When clicking on a website’s link from Google and visitor lands on the page, and if the visitor clicks on any link on that particular web page it auto redirects to URLs containing “shigaxapo”. But if the visitor is not from the search engine it doesn’t re-direct and behaves normally. Only visitors from search engines is redirected and other users are safe from this hacked process. In this article, I will discuss how I solved this malware.
Message I got from the client
From a client, I got a message “can you fix this problem? My website is redirecting visitors to another website, do you know why this is happening?” I hoped in quickly and replied to him “I need to analyze first because every website is different and not one solution fits all and hacking is a complicated procedure to fix”. The client agreed and allowed us to investigate the issue.
Formula to solve a problem
Note: from my past experience I have seen solving a problem or making a change or customization is requires 2 major step: 1) Analyzing the problem and finding a way to fix, it takes 80-90% of the time and 2) rest 10-15% is just actually making the change in codes or files physically.
Scenario:
I saw when I click results from Google and land on the site, and click link on the site it is re directing me to URLs containing “shigaxapo” but when I am on the site it is not re directing anymore, or if I visit the site directly as a visitor it is not re directing and as an admin when logged in it was also not redirecting.
My thoughts:
As it is redirecting to urls containing “shigaxapo”, I “inspect element” with Google Chrome and found nothing, and re direction cannot be done on WordPress by CSS or HTML it must be using javascript or php.
My steps:
So I downloaded the whole site files with Filezilla FTP and searched for the word “shigaxapo” with Notepad++ luckily I found a malware file that is not part of or any other authentic plugin by WordPress. The file was mplugin.php there I analyzed the PHP file and found codes and functions, algorithms to inject the site with such malware. From that php file, I got another file admin_ips.txt where admin ips are stored like this:
2.36.67.193
81.31.155.59
119.30.47.136
My Verdict:
Inside plugins folder it is injected/hacked, this is a plugin that hides itself and activates automatically. You can check from activated plugins that 1 extra plugin is activated but not visible from the wp-admin plugins list.
I deleted those files and ran multiple tests from different devices and re-directing problem was solved successfully. And the client was happy :D.
I will be attaching some codes or the file to make it clear. Leave a comment below if you have any questions or ask me anything.
Share this article if it helps.
If you need help regarding any WordPress/website issues, you can contact me.
On auto scan Wordfence security plugin pointed out a hacked file. From cloudways help they were saying about such file that is taking server resources, maybe this is the file after hackers attacked the site continuously and making the server CPU usage high for last few weeks.