wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.86k stars 241 forks source link

Detected by cloudfare #656

Open FranciscoPalomares opened 1 year ago

FranciscoPalomares commented 1 year ago

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

FranciscoPalomares commented 1 year ago

Access denied Error code 1020

deniskzt commented 1 year ago

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

deniskzt commented 1 year ago

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?

mcastrogg commented 1 year ago

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

vkatochka commented 1 year ago

it can be fixed? or comment it?

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

strukiii commented 1 year ago

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 commented 1 year ago

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.

deniskzt commented 1 year ago

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

picture
strukiii commented 1 year ago

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

hesiod-au commented 1 year ago

+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.

Mouad-scriptz commented 12 months ago

I have the same problem

woodzzzzzz commented 11 months ago

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

milahu commented 7 months ago

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

sounds like we need either/or

... 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:

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