Detecting undetected-chromedriver - Bot Detection (2024)

January 28, 2024 (1 year ago)

This was my interview take-home task for a security company. I'm publishing it three years later, after the vulnerability has been patched. It demonstrates techniques for browser bot detection.

Task

My Solution

undetected-chromedriver adds objectToInspect and result variables to the global scope of every page.

Based on that, we can detect undetected chromedrive. Please check a undetected-chromedriver source code

I wrote a simple solution:

if (objectToInspect === null && result && Array.isArray(result) && result.includes('Array')) {
    await botDetected()
} else {
    await notDetected()
}

The method works since 3.1.0rc1 version (Dec 16, 2021) - commit

Tests

Tested without any bot on:

Tested with undetected_chromedriver version: 3.1.6(newest), 3.1.5, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.1.0rc1

Extra things worth to check

Note

This represents just one day of research on this topic, demonstrating that even a brief investigation can yield effective detection methods for sophisticated browser automation tools.