Cyber Security SpaceCYBERSECURITYSPACE.NET
Community
Community HubEventsNewsletterSubmit a Tool
Careers
JobsCareer GuidesFor ProfessionalsCertifications
Learn
Learning PathsEducationGuidesGlossaryTools
News & Threats
NewsBlogThreat LibraryCrypto Security
Small Business
Security CheckupSecurity GuidesComplianceIncident ResponseSecurity Monitor
Join the community
Cyber Security Space

A community for cybersecurity professionals and enthusiasts: careers, learning, and people to learn with. Practical guidance for small businesses too.

Small Business

  • Security Checkup
  • Security Checklist
  • Security Guides
  • Templates
  • Security Tools

Security

  • Website Security
  • Incident Response
  • Compliance
  • Threat Library
  • Crypto Security

Resources

  • Resources
  • News
  • Blog
  • Glossary
  • Jobs
  • Learning

Company

  • About
  • Sources
  • Contact
  • Privacy Policy
  • Terms
  • Disclaimer
  • Editorial Policy
© 2026 Cyber Security Spacecybersecurityspace.net

Blog

Cloaking

Cloaking serves different content to search engines than to people. It is the mechanism that keeps most injected spam invisible to site owners.

Published 2 Jul 2026 · Updated 14 Aug 2026 · 2 min read

Short answer

Cloaking is the practice of serving different content to search engines than to human visitors, based on signals such as user agent, IP address, referrer or session cookies. On a compromised site it is the delivery mechanism that lets injected spam rank in search while the owner sees a normal page.

How does cloaking work technically?

The injected code inspects the incoming request and branches. Cheap implementations match the user agent string against a list containing Googlebot and Bingbot. More careful ones check the client IP against published crawler ranges, or verify reverse DNS, and cache the verdict so repeat requests stay consistent. Some add a third branch for visitors arriving from search results, which is where redirects are usually attached.

User-agent cloaking
Branching on the User-Agent header, the easiest form to detect.
IP cloaking
Branching on the client IP address, so a spoofed user agent from an ordinary network still sees clean content.
Referrer cloaking
Branching on the Referer header to target only visitors arriving from search engines.

How do you test a page for cloaking?

  1. STEP 01

    Capture a baseline

    Fetch the page with a normal desktop browser user agent and store the HTML.

  2. STEP 02

    Fetch as a crawler

    Repeat with a Googlebot user agent. Any structural difference in body content is a cloaking signal.

  3. STEP 03

    Fetch with a search referrer

    Repeat with a search engine referrer and no cookies to surface referrer-gated payloads.

  4. STEP 04

    Compare against the rendered page

    Use Search Console's URL inspection to see what Google actually received, and compare it with your baseline.

Legitimate variation exists — localisation, A/B tests, paywalls and personalisation. Cloaking is about deceiving the crawler, so judge intent and consistency, not the mere presence of a difference.

Why does cloaking make incidents last longer?

Because the owner's own testing returns clean pages, cloaked compromises are usually reported by a third party: a customer, a search warning, or a partner. That delay gives the attacker time to index thousands of pages and establish persistence, which is why cloaked spam takes longer to clear from search than the technical cleanup itself takes.

Sources

  • Cloaking — Google Search Central
  • Verifying Googlebot — Google Search Central

Prefer summary updates? Subscribe to the newsletter.

On this page

  • How does cloaking work technically?
  • How do you test a page for cloaking?
  • Why does cloaking make incidents last longer?