🔁
Security

Cleaned Site Hacked Again? The Entry Point Is Still Open

27.11.2026
← All articles

Site owners often find themselves in the same loop: malicious files are found and deleted, the site works normally again, and three or four days later everything starts over. The same redirects, the same spam, new unfamiliar files. This is not bad luck, and it usually does not mean the attacker is exceptionally skilled. Repeated infection nearly always means one thing: the symptoms were cleaned up, but the cause is still there. This article covers the most common entry points that stay open and how to check each of them.

Why deleting files is not enough

A website compromise usually happens in two stages. First the attacker gets in through a vulnerability, then leaves several hidden ways back in. The visible part, such as a malicious script on the home page or a spam mailer, comes from the second stage. Remove only that, and both the original vulnerability and the spare entry points remain, so the attacker or their automated script simply comes back and reinstalls everything.

1. Hidden code left behind

The most common cause is a concealed PHP file that was missed during cleanup. It may sit in the uploads folder, the cache, inside a plugin, or carry a system-like name such as wp-tmp.php. Some are injected into the middle of a working file, so the file name gives nothing away. Verifying the CMS core against official checksums and reviewing recently modified files exposes most of them.

cd /var/www/example.uz
wp core verify-checksums
wp plugin verify-checksums --all
find wp-content/uploads -type f \( -name "*.php" -o -name "*.phtml" \)
find . -type f -name "*.php" -mtime -14 | sort

If the core shows modified or extra files, reinstall it with wp core download --force --skip-content, which replaces core files without touching themes or uploads. Reinstall themes and plugins from official sources too, and delete the ones you no longer use.

2. The original vulnerability

If the site was breached through an outdated plugin, it will be breached the same way until that plugin is updated or removed. Automated scanners crawl the web constantly and repeat the attack whenever they find a known vulnerable version. Update the CMS, theme and every plugin right after cleanup with wp plugin update --all, wp theme update --all and wp core update, and replace abandoned plugins that no longer receive fixes.

3. Stolen passwords and extra users

Once inside, an attacker typically grabs the database password from the config file, FTP details and admin sessions, and creates a new administrator account. However clean the files are, that account lets them upload a plugin and restore their code at any time. Review the user list, delete accounts you do not recognise, and change every password: hosting panel, FTP, database, CMS admins and email.

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp config shuffle-salts   # invalidates all logged-in sessions

4. Cron jobs and self-restoring scripts

Experienced attackers also leave a mechanism that restores their code, for example a cron job that downloads a file from a remote server every few minutes. Check crontab -l, the CMS scheduler with wp cron event list, and search the database for injected scripts with wp db search "<script" wp_options --all-tables-with-prefix. On shared hosting cron jobs are listed in the hosting panel, which sayt.uz customers open from the cabinet. Delete any job you did not create, especially one fetching something from an unknown address with curl or wget.

5. Other sites on the same account

Many owners keep several projects in one hosting account: the main site, an old version, a test copy. They all run as the same user, so compromising one gives write access to the rest. Cleaning the main site while leaving a forgotten old.example.uz folder is a classic cause of reinfection. Archive unneeded copies and remove them from the server.

A real-world pattern: a clinic website in Tashkent

A private clinic's site started showing unrelated pharmacy ads in search results. The developer deleted the malicious files, but the problem returned three times in a week. The review found a clean core, but two PHP files left in the uploads folder, a plugin not updated for two years, an administrator nobody recognised and a forgotten test copy on the same account. Only when all of it was closed at once did the infections stop.

Using logs and hardening afterwards

To pinpoint the entry point, find when a malicious file was created with ls -l --time-style=full-iso and look for requests in the same minute of the access log. A POST request to a plugin's upload script seconds before the file appeared tells you exactly what to fix. Then block PHP execution in uploads and disable the built-in file editor:

# wp-content/uploads/.htaccess
<FilesMatch "\.(php|phtml|phar)$">
    Require all denied
</FilesMatch>

# wp-config.php
define( 'DISALLOW_FILE_EDIT', true );

Keep a backup of the clean state separately. If the site keeps getting reinfected and you cannot find the cause, ask support to review the logs and files through a ticket.

Related articles

🗝️ Don't keep passwords and keys in code: managing secrets properly 🔐 Protecting WordPress from Brute Force with fail2ban 🦠 Malware Scanners on Hosting: How They Work and How to Read Results 🔑 Stolen LLM API key: how to cap your costs
🌐 Language
🇺🇿 O⁠'zbek 🇺🇿 Özbek (yangi) 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓