selenium-wire icon indicating copy to clipboard operation
selenium-wire copied to clipboard

Detected by cloudfare

Open FranciscoPalomares opened this issue 2 years ago • 13 comments

Hi, When I use normal undetected chrome driver works ! but when I use with selenium wire, its detected. Thanks

FranciscoPalomares avatar Feb 23 '23 16:02 FranciscoPalomares

Access denied Error code 1020

FranciscoPalomares avatar Feb 23 '23 17:02 FranciscoPalomares

I have the same problem webdriver - 112 Chrome - 112 Selenium Wire - 5.1.0 undetected chromedriver - 3.4.6

deniskzt avatar Apr 06 '23 18:04 deniskzt

The latest version of selenium-wire use the old version of undetected_chromedriver 3.1.0. The current version of undetected_chromedriver is 3.4.6 Can someone tell me how to adapt 3.4.6 to Selenium 5.1.0?

deniskzt avatar Apr 08 '23 15:04 deniskzt

having the same issue chrome webdriver - 112 selenium wire - 5.1.0 selenium - 4.8.3 undetected_chromedriver - 3.4.6

  • Keep hitting cloudflare turnstile.
  • Getting certificate is not valid when using the undetected chromedriver via selenium-wire.
  • When I use the undetected chrome driver itself the certificate issue is not present.

mcastrogg avatar Apr 12 '23 21:04 mcastrogg

it can be fixed? or comment it?

  • selenium-wire certificate is not valid
  • update undetected_chromedriver support to latest version

my env: selenium wire - 5.1.0 undetected_chromedriver - 3.4.6 chrome/chromedriver- 112

vkatochka avatar Apr 13 '23 06:04 vkatochka

I'm running into the same problem, opened another issue here further explaining. Sorry if this was bad etiquette. https://github.com/wkeeling/selenium-wire/issues/669.

strukiii avatar Apr 18 '23 16:04 strukiii

Seleniumwire does import the updated version of undetected chromedriver, see /seleniumwire/undetected_chromedriver/webdriver.py line 6. Add print(uc.__version__) and you'll see it is in fact using the version in your venv. Also, the certificate being invalid isn't the problem, you can add a self signed cert to get rid of the insecure warning.

strukiii avatar Apr 18 '23 20:04 strukiii

@strukiii The latest version of selenium wire only supports undetected_chromedriver version 3.1.0 picture

deniskzt avatar Apr 19 '23 12:04 deniskzt

@deniskzt I understand that's what the commit message says, I read that too, but I showed how you can verify the version yourself.

strukiii avatar Apr 19 '23 17:04 strukiii

+1 on this issue. Can confirm issue is present in selenium-wire using undetected chromedriver 3.4.6 but not present when using selenium and undetected chromedriver 3.4.6 to do the same actions. Selenium-wire must be doing something which is making the driver more detectable.

hesiod-au avatar May 06 '23 03:05 hesiod-au

I have the same problem

Mouad-scriptz avatar Jul 10 '23 14:07 Mouad-scriptz

It seems the issue is not with selenium wire itself but with cloudflare detecting proxy/certificate, and selenium wire uses a self signed certificate for mitmproxy proxy. If we just launch a default chrome binary with a proxy flag, like:

chrome --proxy-server=127.0.0.1:8080

(local proxy with self signed certificate) then it triggers the cloudflare antibot protection.

I tried the same self signed certificate on firefox and it works like a charm but, unfortunately, there is no "undetected firefox" just yet

woodzzzzzz avatar Aug 03 '23 16:08 woodzzzzzz

It seems the issue is not with selenium wire itself but with cloudflare detecting proxy/certificate

sounds like we need either/or

  • a patched version of chromium
  • a dynamic analysis tool like frida to insert hooks into the chromium binary

... to pipe all requests and responses through a local http proxy for passive tracing and active intercepting of https traffic

tracing https traffic with frida:

  • https://gaiaslastlaugh.medium.com/frida-as-an-alternative-to-network-tracing-5173cfbd7a0b
  • https://andydavies.me/blog/2019/12/12/capturing-and-decrypting-https-traffic-from-ios-apps/
  • https://stackoverflow.com/questions/46711786/android-hooking-https-traffic-using-frida
  • https://frida.re/docs/frida-trace/

or simpler: use a local socks5h proxy server to capture the encrypted https traffic and decrypt it with the TLS key (but this only allows passive tracing)

https://andydavies.me/blog/2019/12/12/capturing-and-decrypting-https-traffic-from-ios-apps/

To decrypt the packets we need the matching TLS keys, Chrome and Firefox will provide these when the SSLKEYLOGFILE environment variable is set

socks5h proxy server

see also

  • https://github.com/wkeeling/selenium-wire/issues/67

milahu avatar Dec 09 '23 12:12 milahu