Guides · Malware
The fake CAPTCHA on your WordPress site, and why you can't see it
Picture a customer landing on your website. Instead of your homepage, they get a little box asking them to prove they're human. Fair enough, they think, and tick it. Then the box asks them to press the Windows key and R, then Ctrl and V, then Enter.
A lot of people do it. Those three key presses run a command on their own computer, and that command quietly downloads malware. From your website.
This trick is called ClickFix, and we keep finding it on hacked WordPress sites. It's nasty for two reasons. It doesn't need some clever browser exploit, it simply asks people to infect themselves. And the person who owns the site almost never sees it.
What your visitors actually see
It usually looks like a Cloudflare check or a Google reCAPTCHA box. There's a tick box that says "I'm not a robot", and after the tick come the instructions. Press Win + R. Press Ctrl + V. Press Enter. Some versions are translated into other languages, and we've seen one that asked for Win + E instead, which opens File Explorer and works the same way.
What the visitor doesn't know is that the page has already copied a command to their clipboard. When they paste it into the Windows Run box, it starts PowerShell in a hidden window, downloads a script from a server the attacker controls and runs it. In most reports that script installs something that steals saved passwords, browser logins or crypto wallets. Some versions also carry a Mac or Linux command that asks the visitor to open Terminal instead.
Never run the command to see what it does. Not even on a spare laptop. If you need to know what it downloads, leave that to someone with a proper malware lab.
Why you probably haven't noticed
This is the part that makes ClickFix so effective. The script is written to stay out of the owner's way.
- It only shows once per browser. After the first visit it saves a note in the browser and never shows the box to that browser again. You visited your own site a hundred times, so you're the last person who'll see it.
- It only targets Windows. Visit on a Mac or a phone and the page looks normal. Some versions even check whether the computer looks like a virtual machine and skip the show if it does, which keeps security researchers away.
- It deletes itself from the page. Once it runs, the script removes its own tag. If you open your browser's developer tools to look around, it's already gone.
So the owner opens the site, everything looks fine, and meanwhile some of their customers are being told to paste a command into Windows. In one recent cleanup, the owner could load the site perfectly while a colleague kept hitting the fake check. That mismatch is often the first clue.
How it gets into WordPress
The fake check is a block of JavaScript, but something on the server has to add it to every page. In that cleanup, the script sat right at the very top of the page head, before the output from the SEO plugin. That position tells you PHP was adding it early while WordPress builds the page. It wasn't part of the theme's normal markup.
The usual hiding places are:
- a plugin that was modified, or a fake plugin with a believable name
- the theme's functions.php file
- the "must use" plugins folder, which loads automatically and doesn't show up in the normal plugin list
- a database option that gets printed into every page
There were other pieces too. The uploads folder held files that weren't PHP at all: an HTML file with a cached copy of the fake check, and JSON and text files that looked like a log of visitors. The script also talked back to an address on the site itself, something like /cdn/verify. Because the site answered those requests, there had to be code on the server handling them.
And the hosting account had a second website on it. That one was infected too.
How to check your site
The easiest way is our free spam check. It loads your homepage the way a Windows visitor would and reads the raw page, scripts included, so it doesn't matter that the fake check hides itself in a real browser. It looks for the combination that gives ClickFix away: something copied to the clipboard, a command that downloads and runs code, and instructions to press Win + R. A normal copy button on a tutorial page won't set it off.
If you're comfortable with a terminal, you can look yourself. This fetches your homepage as Windows Chrome and searches it for the usual signs:
curl -s -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/131.0 Safari/537.36" "https://yoursite.com/?nocache=1" | grep -iE "clipboard|powershell|DownloadString|atob\("
No output is a good sign, but not a guarantee. If you see powershell or DownloadString near a clipboard call, treat it as serious. A site that teaches people to code can match too, so read what turned up before you panic.
Cleaning it up properly
Deleting the script from a cached page does nothing. It comes straight back on the next page load. You need to find whatever is adding it. Here's what we've learned about where cleanups go wrong.
- Take a full backup first, files and database. It's your evidence, and your way back if something breaks.
- Reinstall every plugin and theme from a clean copy, not just the ones that look suspicious. In the case above, the first cleanup left twenty plugins as they were, and the injector was still live afterwards.
- Open the must use plugins folder and check the database options. Both are easy to forget and both survive a plugin reinstall.
- Search the uploads folder for every file type, not only PHP. The first cleanup only looked for PHP files there and missed all three leftover files.
- Check every site on the same hosting account. If one is infected, assume the others might be.
- Change the passwords for WordPress admins, hosting, the database and SFTP, and log everyone out. Look for admin accounts you don't recognise.
- Clear every cache once you're done: your caching plugin, your host's cache and Cloudflare if you use it.
- Check again from the outside as a Windows visitor, then once more the next day. "It loads fine for me" means nothing with this one.
If your visitors may have run it
This is the uncomfortable bit. If your site was showing the fake check for a while, some visitors may have followed the steps. If you have a customer list, it's worth a short, honest note telling them what happened and suggesting they run a malware scan and change important passwords from a device they trust. It's not a fun email to send, but people tend to appreciate hearing it from you first.
Need a hand?
If the free check flags your site, or you've cleaned it once and the fake check keeps coming back, we can investigate and clean it properly. You'll get a written report of what we found, what we changed and what's left to do. We agree the scope and price with you before any paid work starts.