Imperva (formerly known as Incapsula) is a sophisticated cloud-based application delivery service that provides comprehensive web security, DDoS protection, CDN, and load balancing capabilities. When it detects potential automated access, it interrupts browser automation with an interstitial page requiring a security check, typically in the form of an hCaptcha challenge.
Imperva employs a multi-layered approach to detect and prevent automated access:
The security system performs extensive environment checks across several categories:
Core Navigator Properties
navigator.userAgent
)navigator.webdriver
)plugins.length > 0
)Automation Detection
window._Selenium_IDE_Recorder
)window._phantom
)window.__nightmare
)Device Characteristics
screen.width
and screen.height
)/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i
/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/
The fingerprint data collection process follows these steps:
_dcheck
with 24-hour expirationTechnical Note: Failed checks are not discarded but rather recorded with their corresponding error messages, providing additional fingerprinting data.
The hCaptcha challenge appears within an iframe when Imperva's security checks detect suspicious patterns. To handle this efficiently, we've developed the open-source library rebrowser-patches which provides full support for working with iframes while maintaining undetectability. The key components involved are:
When dealing with Imperva's security measures, several network-related factors are crucial:
When investigating Imperva's initial browser verification script, we encountered heavily obfuscated code that needed to be analyzed. In 2024, we have powerful tools at our disposal that make this task significantly easier - modern Large Language Models (LLMs) like ChatGPT or Claude.
These AI models can quickly deobfuscate complex JavaScript code, providing readable versions in seconds. This capability has revolutionized the analysis of security systems, allowing us to better understand how they operate.
Pro Tip: When working with obfuscated code, modern LLMs can not only deobfuscate it but also provide insights about the security mechanisms being implemented. This makes it much easier to understand and work with complex security systems.
Through this analysis, we discovered that the script performs extensive environment checks and stores results in Base64-encoded cookies. This understanding led to the development of more effective handling strategies in our rebrowser-patches library.
For testing purposes, you can deliberately trigger the security check using this code:
await page.evaluateOnNewDocument(() => { window._Selenium_IDE_Recorder = 1 })
This sets one of the automation detection flags, forcing the security system to display the challenge page.
Using our rebrowser-patches library, the process of solving the hCaptcha challenge involves:
hCaptcha regularly updates its challenge datasets, making automated solving increasingly complex. While AI solutions exist, human-powered solving services often provide more reliable results.
Key Feature: All our cloud browsers fully support automatic detection and solving of Imperva security checks, typically completing the process in under 10 seconds.
The automatic solving process involves:
This automation capability eliminates the need for manual intervention in most cases, making it ideal for:
When interacting with Imperva-protected websites, keep in mind:
Understanding Imperva's security mechanisms is crucial for developing effective and compliant automation solutions. Our open-source rebrowser-patches library provides the tools needed to handle these challenges properly while maintaining undetectability.
For more detailed information about handling CAPTCHAs and security challenges, please refer to our documentation.