➽Explainer Article

User Agent Cloaking in Phishing Websites: How Attackers Evade Detection

Sep 12, 2025
|
by Cyber Analyst
User Agent Cloaking in Phishing Websites: How Attackers Evade Detection

➤Summary

Phishing websites have grown more sophisticated, making detection harder than ever. One of the stealthiest tactics now in use is user agent cloaking, where websites present different content depending on who — or what — is visiting.

If a security scanner or crawler loads the page, it sees a harmless blank site or a redirect to a legitimate domain. But if a real user opens the same link on a browser like Chrome or Safari, the site reveals its true nature: a credential-stealing page disguised as a login portal, payment gateway, or account recovery screen.

By cloaking phishing content in this way, attackers gain critical time. Cloaked phishing websites can stay online longer, trick more victims, and steal more data before takedown efforts succeed. In this post, we’ll explore how user agent cloaking works, share real-world examples, explain detection methods, and provide a checklist for defense against this increasingly common evasion technique. 😰

What is User Agent Cloaking?

A user agent string is a short identifier sent with every web request. It reveals details such as the visitor’s browser, operating system, and device type. Here’s a common example from Safari on iOS:

Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1

Attackers abuse this by cloaking content. If the site detects a request from a crawler or bot, it serves a decoy page. If the request matches a human browser, it serves the phishing page. This ensures that security tools relying on a single scan never see the real malicious content.

While the idea originated in SEO manipulation, cybercriminals now use user agent cloaking to hide phishing kits, malware payloads, and redirect chains. It is just one form of cloaking — others include geo-based cloaking (showing phishing only to certain regions), time-based cloaking (active only during work hours), and mobile-only cloaking. Together, these tricks make phishing websites much harder to uncover. 🎭

How User Agent Cloaking Works in Phishing Websites

Most phishing kits include cloaking logic by default. The typical flow looks like this:

  1. Request received
    The phishing server inspects the HTTP headers, especially the user agent string.

  2. Scanner identified
    If the visitor matches a known crawler — such as Googlebot, Microsoft Defender, or antivirus engines — the server serves a safe placeholder, an error message, or even redirects to the real brand’s homepage.

  3. Human visitor detected
    If the visitor looks like a genuine user (Chrome on Windows, Safari on iPhone, Edge on Android), the phishing content loads. This could be a fake banking portal, a Microsoft 365 login, or a crypto wallet drainer.

  4. Extra conditions applied
    Many campaigns add IP-based checks, ensuring only visitors from certain geographies see the malicious content. Others load phishing only during specific hours or if the device appears to be mobile.

This selective serving makes cloaked phishing nearly invisible to traditional scanners.

Real-World Examples of User Agent Cloaking

1. Toll and Invoice Fraud

Fraudulent payment sites designed to look like government toll portals have been observed cloaking based on user agent. If a crawler visits, the site returns a “404 error” or redirects to Wikipedia. If a human visits through a Chrome browser, it loads a perfect toll payment form — complete with branding — that captures credit cards.

2. Mobile-Specific QR Campaigns

In campaigns tied to QR code phishing, attackers hide payloads unless the user agent shows a smartphone. If visited from desktop or a security sandbox, the page redirects to a legitimate Microsoft or Google site. But when scanned from an iPhone, the link delivers a phishing page imitating a banking app login. 📱

3. Region-Locked Banking Malware

Banking malware campaigns, such as those distributing the Mispadu trojan, have combined user agent cloaking with language settings. If the browser language is Spanish, the phishing site displays a fake login page. If it’s English or French, the site loads nothing. Researchers outside the target region saw only blank pages, delaying discovery.

4. OS-Based Payload Delivery

Some phishing kits check the operating system. If the visitor is on Linux or macOS (often analysts’ machines), the site shows a message like “This page is optimized for Windows only.” Actual Windows users, however, receive the full malicious payload.

These examples demonstrate how cloaked phishing can fine-tune its targeting, ensuring only victims — not defenders — see the attack.

Banner1

Why User Agent Cloaking Works So Well

Cloaked phishing is highly effective because it undermines the very foundation of automated defense:

  • Scanner evasion: Most security tools rely on predictable crawlers. Cloaking hides the real threat from them.

  • Short attack windows: With phishing websites often live for less than 24 hours, a single missed scan is enough for attackers to succeed.

  • False negatives: Cloaking tricks analysts into thinking a suspicious link is clean, delaying takedown.

  • Precision targeting: By filtering by agent, IP, or language, attackers maximize success while minimizing exposure. ⚠️

How to Detect User Agent Cloaking

Multi-Profile Scanning

Always scan suspicious URLs with multiple user agents. Tools like curl make this easy:

curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X)" https://example.com

Compare what different agents receive. If one agent sees a blank page and another sees a login form, cloaking is confirmed.

Multi-Region Testing

Use VPNs or proxy nodes to scan from multiple geographies. Many cloaked phishing websites activate only in certain countries. 🌍

Headless Browser Automation

Deploy headless browsers like Puppeteer or Selenium. These render the page fully, execute JavaScript, and simulate clicks — revealing content hidden from simple crawlers.

Code and Behavior Analysis

Inspect the HTML and JavaScript. Look for conditional statements that check for “Googlebot” or contain long lists of blocked user agents. Redirect chains triggered by certain headers are a strong sign of cloaking.

Cross-Validation with Reports

If employees report phishing but automated scans show “no issue,” treat this as a red flag. Cloaked phishing thrives on such blind spots.

Checklist for Spotting Cloaked Phishing

✅ Rotate multiple user agents during scanning
✅ Test from both desktop and mobile profiles
✅ Use residential IPs to mimic real user traffic
✅ Capture screenshots across environments for comparison
✅ Analyze redirect chains for inconsistencies
✅ Include cloaking detection in SOC playbooks
✅ Educate users that “not flagged” doesn’t mean “safe”

Defensive Strategies for Organizations

  • Upgrade detection tools: Ensure your scanners rotate through multiple user agents and geographies.

  • Threat hunting with realism: Monitor from endpoints and proxies that look like everyday users.

  • Enhance awareness: Train employees that phishing websites may look harmless to machines but dangerous to humans.

  • Harden access controls: Strong multi-factor authentication (MFA) limits the damage even if credentials are stolen.

  • Improve incident response: Update playbooks to test links under varied conditions before closing an investigation.

  • Accelerate takedowns: Evidence must include screenshots of the phishing content — captured using the right agent — to convince hosts and registrars to act quickly.

Related Cloaking Techniques

User agent cloaking rarely works alone. Attackers combine it with:

  • Geo-cloaking: Only serve phishing in specific regions.

  • Time-based cloaking: Activate phishing during work hours or campaign-specific timelines.

  • First-visit cloaking: Show phishing only the first time a link is visited, then redirect to a safe site.

  • Hybrid obfuscation: Mix cloaking with URL shorteners, encrypted parameters, or tokenized redirects. 🔀

Understanding these variations helps defenders anticipate evasive behaviors beyond just user agent checks.

Why Traditional Security Struggles

Most enterprise defenses assume that scanning a URL once equals certainty. Cloaking breaks that assumption. Studies have shown that roughly one-third of phishing attacks now employ cloaking, making them invisible to single-pass crawlers. As phishing websites continue to evolve with cloaking, QR payloads, and malvertising, defenders must evolve their techniques too.

Conclusion

User agent cloaking has become a core technique in modern phishing websites, allowing attackers to trick machines and target humans. It’s effective because it creates blind spots: scanners see clean pages, while victims see credential traps.

Defenders must adapt by scanning from multiple user agents, multiple geographies, and using headless browsers that mimic real interaction. They must also train employees to report suspicious emails even if filters pass them, and refine incident response playbooks to include cloaking checks.

Phishing will always be a cat-and-mouse game, but understanding how user agent cloaking works removes one of the attacker’s biggest advantages. 🚀

Try Spoofguard NOW : Security Application that Automatically Detects Phishing Sites and Scams

🛡️ Is your domain already being spoofed?

SpoofGuard detects domain impersonation and phishing threats in real time. Don’t wait until damage is done.

Request a demo →