Accepting projects ·CZ Get in touch →

Your website shows Google something different than it shows you: how to spot a hidden hack

Cloaking feeds spam to search engines and the website owner can't see it. How we found it and where to look for it in Search Console.

You open your website and everything looks fine. Meanwhile Google indexes thousands of pages of spam in a foreign language under your domain. This is called cloaking, and it's one of the nastiest kinds of hack, because the website owner can't see it.

How cloaking works

The attacker replaces the file the website starts with, usually index.php. On every request it looks at who is asking. To a normal visitor it returns the normal website. To a search engine bot it returns spam pages that earn the attacker money from links and ads. Thousands of addresses appear under your domain that you will never see.

This kind of malware usually doesn't work alone. It adds hidden administrator accounts to the website, backdoors, and a script that puts the replaced file back after a cleanup.

How we found it

On a company WordPress website, the first hidden administrator account appeared on 21 July 2026. By 4 August the attacker had created five, and gave some of them a fake registration date to make them look old. In the meantime, on 27 July, they overwrote the website's start file and placed backdoors in folders where nobody would look.

We found the hack by chance, while looking into why Google Analytics reported no traffic. The malware had removed the tracking code from the website and meanwhile served foreign-language spam to Googlebot. In a single day the bot downloaded 37,779 such addresses.

Lukáš Hrubý Managing director, HRUBY Software

The likely way in was an old 2022 backup with the whole database, left in the website's public folder from the previous administrator's time, which could be downloaded. The second weakness was a database port open to the internet with a weak password. We restored the website on 8 August by fully rebuilding the files from official sources, with a database verified as clean.

How to spot a hidden hack on your website

  1. Search Console, Pages report. A sharp rise in indexed or discovered addresses you don't know is the strongest sign. In our case they looked like /?x=….
  2. Search Console, Performance report. Search queries in a foreign language or for goods you don't sell.
  3. A site:yourwebsite.com search on Google. Titles in French or German on a Czech website need no further explanation.
  4. URL Inspection in Search Console and the “Test live URL” button. It shows what Googlebot gets. This is more reliable than faking the browser identification, because smarter malware also checks the bot's IP address.
  5. Traffic analytics suddenly drop to zero. It may be a technical fault, but it's worth checking whether the tracking code is on the website at all.

Why a normal scanner doesn't see it

Automated tools download the page like a normal visitor and get the clean version. We tried adding a hidden spam check to the Vulscan scanner. On 946 live websites it found 18 cases, and all 18 were false alarms. So we didn't release the check. Cloaking is reliably detected only by comparing what the search engine gets, and Search Console can do that.

What to do if your website is hacked

  • Put the website into maintenance mode and download a copy of the files and the database for later analysis.
  • Don't clean it in place. Rebuild the files from official sources and remove unknown accounts from the database.
  • Change all passwords: hosting, FTP, database, admin. Generate new WordPress security keys, which logs out all sessions.
  • In the hosting control panel, check scheduled tasks and FTP accounts. If the replaced file keeps coming back even after the passwords are changed, the attacker has access there too.
  • In Search Console, request a new crawl and the removal of the spam addresses.

When to call in an expert

Right away, as soon as you see addresses you don't know in Search Console. In our case the hosting kept access logs for only seven days, and the sooner you start, the more traces remain. We go through the website, find out how far the hack goes, restore it from clean sources and close the path the attacker came in by. If you're on WordPress, also read the article about the forgotten doors of WordPress.

Written by Ing. Lukáš Hrubý, HRUBY Software · ← All articles

Dealing with the same thing?

We'll look at it with you. The first consultation is free. More about the service: Security Audits.

Book a consultation →
// Contact

Get in touch.

Tell us what you need, or just call. We reply within one business day.

// Encrypted in transit · privacy policy