AWS Builder Center

The Ghost in Your .gov.in Site: Detecting Invisible Website Hijacks

How we built Pehredaar, a read-only scanner that catches cloaking attacks silently hijacking Indian government and college websites for gambling SEO spam.

Student building something interesting
Somewhere right now, a government website in India is showing two completely different faces. To you, visiting it in a browser, it looks exactly like it should, official, unremarkable, trustworthy. But to Google's crawler, that same URL might be serving gambling and betting spam.
This is cloaking, and it's a quietly devastating attack. Hackers compromise a legitimate .gov.in or .ac.in domain, inject spam content that's only served to search engine crawlers, and leave the human-facing site untouched. The site owner sees nothing wrong. Meanwhile, the domain's decades of accumulated trust and search authority get hijacked to rank gambling pages on Google, sometimes for months before anyone notices.
We built Pehredaar to catch this, before it does more damage.

The Detection Idea

The core insight is simple: if cloaking hides content from real visitors but shows it to crawlers, then the attack itself creates a detectable signal, a mismatch. Pehredaar fetches a target site under four distinct fetch profiles, simulating a real browser and different crawler identities, then compares what each one actually receives. A site that's clean returns the same content across all four. A cloaked site doesn't.
It's read-only by design. Pehredaar never modifies anything, it only observes and reports, which matters a lot when the target is a real institutional website.

Building and Shipping on AWS

[FILL IN: which AWS services you used and what each does, e.g. "We deployed the scanning engine on [service], with results stored in [service] and exposed via [service]."]

What We Learned

[FILL IN: one real, specific lesson from building this in a compressed timeline.]
Pehredaar is small, focused, and read-only on purpose. In a space full of hackathon projects trying to do everything, we wanted to do one specific, real thing well: make an invisible attack visible.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article