Can a website detect when you are using selenium with chromedriver?

后端 未结 19 3190
情歌与酒
情歌与酒 2020-11-21 05:41

I\'ve been testing out Selenium with Chromedriver and I noticed that some pages can detect that you\'re using Selenium even though there\'s no automation at all. Even when I

19条回答
  •  耶瑟儿~
    2020-11-21 06:10

    Obfuscating JavaScripts result

    I have checked the chromedriver source code. That injects some javascript files to the browser.
    Every javascript file on this link is injected to the web pages: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/js/

    So I used reverse engineering and obfuscated the js files by Hex editing. Now i was sure that no more javascript variable, function names and fixed strings were used to uncover selenium activity. But still some sites and reCaptcha detect selenium!
    Maybe they check the modifications that are caused by chromedriver js execution :)


    Edit 1:

    Chrome 'navigator' parameters modification

    I discovered there are some parameters in 'navigator' that briefly uncover using of chromedriver. These are the parameters:

    • "navigator.webdriver" On non-automated mode it is 'undefined'. On automated mode it's 'true'.
    • "navigator.plugins" On headless chrome has 0 length. So I added some fake elements to fool the plugin length checking process.
    • "navigator.languages" was set to default chrome value '["en-US", "en", "es"]' .

    So what i needed was a chrome extension to run javascript on the web pages. I made an extension with the js code provided in the article and used another article to add the zipped extension to my project. I have successfully changed the values; But still nothing changed!

    I didn't find other variables like these but it doesn't mean that they don't exist. Still reCaptcha detects chromedriver, So there should be more variables to change. The next step should be reverse engineering of the detector services that i don't want to do.

    Now I'm not sure does it worth to spend more time on this automation process or search for alternative methods!

提交回复
热议问题