Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webdriver can be detected #866

Open
marcusdiy opened this issue Jan 4, 2024 · 1 comment
Open

Webdriver can be detected #866

marcusdiy opened this issue Jan 4, 2024 · 1 comment
Labels
issue: bug report A bug has been reported needs triage

Comments

@marcusdiy
Copy link

marcusdiy commented Jan 4, 2024

There is a problem, the webdriver can be detected as following:
let usesWebdriver = navigator.__proto__.webdriver and will evaluate to true
seems like adding delete navigator.__proto__.webdriver; works to hide this fact

For example in: evasions\navigator.webdriver\index.js

  async onPageCreated(page) {
    await page.evaluateOnNewDocument(() => {
      if (navigator.webdriver === false) {
        // Post Chrome 89.0.4339.0 and already good
        delete navigator.__proto__.webdriver;
      } else if (navigator.webdriver === undefined) {
        // Pre Chrome 89.0.4339.0 and already good
      } else {
        // Pre Chrome 88.0.4291.0 and needs patching
        delete Object.getPrototypeOf(navigator).webdriver
      }
    })
  }
@marcusdiy marcusdiy added issue: bug report A bug has been reported needs triage labels Jan 4, 2024
@toleblanc
Copy link

toleblanc commented Jan 30, 2024

@marcusdiy

I cannot get this to work.

> let usesWebdriver = navigator.__proto__.webdriver
< TypeError: The Navigator.webdriver getter can only be used on instances of Navigator

> usesWebdriver = Navigator.__proto__.webdriver
< ReferenceError: Cannot access uninitialized variable.

Can you help? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug report A bug has been reported needs triage
Projects
None yet
Development

No branches or pull requests

2 participants