A backdoor is code an attacker leaves behind after the first break-in so they can return even after passwords change and the hole is patched. That is why so many owners say "I cleaned it, and a week later it happened again". Here are ten signs of a WordPress backdoor and the commands to check them. Run them over SSH in the site root, and back up files and the database first.
Signs in the files
1. PHP files in uploads
Apart from an occasional empty index.php, PHP has no business in wp-content/uploads:
find wp-content/uploads -type f -name "*.php"
2. Obfuscated code
Long base64 strings and chains of eval, gzinflate or str_rot13 are typical. Legitimate plugins use these functions too, so review the hits, especially lines that combine them:
grep -rlE "eval\(|base64_decode\(|gzinflate\(|str_rot13\(" --include=*.php .
3. Modified or extra core files
Core files are identical for each version. Checksum verification lists changed files and, with "File should not exist", extra files planted in wp-includes or wp-admin under core-like names:
wp core verify-checksums
wp plugin verify-checksums --all
4. mu-plugins and unknown plugin folders
Files in wp-content/mu-plugins run automatically and do not appear in the normal plugin list. If you never created that folder, inspect everything in it.
5. Recently modified files
find . -type f -name "*.php" -mtime -7 -ls
find . -type f -name ".*.php"
Attackers can fake timestamps, so weigh this together with the other signs.
6. Hidden settings in .htaccess and .user.ini
auto_prepend_file runs a file before every PHP request, and redirect rules aimed only at bots or mobile users are another red flag:
grep -rn "auto_prepend_file" . --include=.htaccess --include=.user.ini --include=php.ini
Signs in the database and behaviour
7. Administrators you did not create
Compare wp user list --role=administrator with the wp_usermeta table, since malware can hide users from the dashboard.
8. Odd scheduled events
wp cron event list --fields=hook,next_run_relative,recurrence
Look for hook names that belong to no installed plugin; they may re-download the malware.
9. Foreign scripts in the database
wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%<script%'"
wp db query "SELECT option_name FROM wp_options WHERE option_value LIKE '%eval(%'"
10. Content only outsiders see, and spam mail
Some malware shows spam only to search bots. Casino or pharma results under your brand in Google, or a host warning about mass mail, point to an active backdoor:
curl -s -A "Googlebot" https://misol.uz | grep -iE "casino|viagra|loan"
Example: a construction company in Namangan
Casino pages started appearing in Google for a construction firm's site, misol.uz, while the owner saw nothing wrong. A PHP file disguised as an image sat in uploads, .user.ini contained an auto_prepend_file line, and a cron event re-downloaded the file every night. Only after removing all three, reinstalling core and rotating passwords did the reinfections stop.
After you find it
Reinstall core with wp core download --force --skip-content, replace plugins and themes with clean copies, rotate passwords and run wp config shuffle-salts. Above all, find out how the attacker got in: check server logs around the dates of the suspicious files and update or remove the plugin that let them in, otherwise a new backdoor will appear soon. On sayt.uz hosting, ISPmanager backups help you locate a pre-infection state.